Guest User

Untitled

a guest
Jul 19th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. ngOnInit() {
  2. this.isLoading = true;
  3. this.form = new FormGroup({
  4. annotation: new FormControl(null, {
  5. validators: [
  6. Validators.required,
  7. Validators.minLength(8),
  8. Validators.maxLength(250)
  9. ]
  10. })
  11. });
  12. this.id = this.route.snapshot.paramMap.get('postId');
  13. this.annotationService.getWords();
  14. this.postsService.getPosts();
  15.  
  16. this.annotationSub = this.annotationService
  17. .getWordUpdateListener()
  18. .subscribe((thewords: ComplexWord[]) => {
  19. this.thewords = thewords;
  20. this.thewords.map(word => {
  21. this.theHardWords.push(word.word);
  22. this.wordWithAnnotation.push(word);
  23. });
  24. });
  25.  
  26. this.postsSub = this.postsService
  27. .getPostUpdateListener()
  28. .subscribe((posts: Post[]) => {
  29. this.posts = posts;
  30. this.posts.map(post => {
  31. if (post.id === this.id) {
  32. this.postIWant = post.fileText;
  33. }
  34. });
  35. });
  36.  
  37. this.role = this.authService.getUserRole();
  38. this.userIsAuthenticated = this.authService.getIsAuth();
  39. this.authStatus = this.authService
  40. .getAuthStatus()
  41. .subscribe(isAuthenticated => {
  42. this.userIsAuthenticated = isAuthenticated;
  43. this.role = this.authService.getUserRole();
  44. });
  45. this.isLoading = false;
  46. }
Add Comment
Please, Sign In to add comment