Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ngOnInit() {
- this.isLoading = true;
- this.form = new FormGroup({
- annotation: new FormControl(null, {
- validators: [
- Validators.required,
- Validators.minLength(8),
- Validators.maxLength(250)
- ]
- })
- });
- this.id = this.route.snapshot.paramMap.get('postId');
- this.annotationService.getWords();
- this.postsService.getPosts();
- this.annotationSub = this.annotationService
- .getWordUpdateListener()
- .subscribe((thewords: ComplexWord[]) => {
- this.thewords = thewords;
- this.thewords.map(word => {
- this.theHardWords.push(word.word);
- this.wordWithAnnotation.push(word);
- });
- });
- this.postsSub = this.postsService
- .getPostUpdateListener()
- .subscribe((posts: Post[]) => {
- this.posts = posts;
- this.posts.map(post => {
- if (post.id === this.id) {
- this.postIWant = post.fileText;
- }
- });
- });
- this.role = this.authService.getUserRole();
- this.userIsAuthenticated = this.authService.getIsAuth();
- this.authStatus = this.authService
- .getAuthStatus()
- .subscribe(isAuthenticated => {
- this.userIsAuthenticated = isAuthenticated;
- this.role = this.authService.getUserRole();
- });
- this.isLoading = false;
- }
Add Comment
Please, Sign In to add comment