Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- constructor(private chapterService: ChapterService, private userSevice:ApiService, private route: ActivatedRoute, private ngZone: NgZone) {
- this.route.paramMap.subscribe(params => {
- this.ngOnInit();
- });
- this.chapterNumber = "0";
- this.username=localStorage.getItem("loggedUserUsername")
- //get chapter number save from user
- }
- getChapter(): any {
- const chN = this.route.snapshot.paramMap.get("chNumber");
- if (chN) {
- this.notificationVisible=false;
- return this.chapterService
- .GetChapterByChapterNumber(chN)
- .pipe(
- map(
- (data) => {
- this.chapter = data;
- }))
- }
- }
- ngOnInit(): void {
- this.getChapter().subscribe(() => {
- console.log('ngOnit after getChapter() ' + this.chapter);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement