Advertisement
EntropyStarRover

Untitled

Aug 10th, 2021
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. constructor(private chapterService: ChapterService, private userSevice:ApiService, private route: ActivatedRoute, private ngZone: NgZone) {
  2. this.route.paramMap.subscribe(params => {
  3. this.ngOnInit();
  4. });
  5. this.chapterNumber = "0";
  6. this.username=localStorage.getItem("loggedUserUsername")
  7. //get chapter number save from user
  8. }
  9.  
  10. getChapter(): any {
  11. const chN = this.route.snapshot.paramMap.get("chNumber");
  12. if (chN) {
  13. this.notificationVisible=false;
  14. return this.chapterService
  15. .GetChapterByChapterNumber(chN)
  16. .pipe(
  17. map(
  18. (data) => {
  19. this.chapter = data;
  20.  
  21. }))
  22.  
  23. }
  24. }
  25.  
  26. ngOnInit(): void {
  27. this.getChapter().subscribe(() => {
  28. console.log('ngOnit after getChapter() ' + this.chapter);
  29. });
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement