Guest User

Untitled

a guest
Jul 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. ///// With this it gives me the error.
  2. const posts = data[1].posts;
  3. posts.map(post => {
  4. if (post.id === this.id) {
  5. this.postIWant = post.fileText;
  6. }
  7. });
  8.  
  9. /////////////////////////////////////
  10.  
  11. ////// The old way didnt.
  12. /// OLD way below
  13.  
  14. this.postsSub = this.postsService
  15. .getPostUpdateListenerTwo()
  16. .subscribe((posts: Post[]) => {
  17. this.posts = posts;
  18. this.posts.map(post => {
  19. if (post.id === this.id) {
  20. this.postIWant = post.fileText;
  21. }
  22. });
  23. });
Add Comment
Please, Sign In to add comment