Angular LMS app
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。
 
 
 
 

39 行
938 B

  1. import { Component, OnInit } from '@angular/core';
  2. import { ActivatedRoute } from '@angular/router';
  3. import { Subscription } from 'rxjs';
  4. import { Location } from '@angular/common';
  5. @Component({
  6. selector: 'app-details',
  7. templateUrl: './details.component.html',
  8. styleUrls: ['./details.component.scss']
  9. })
  10. export class DetailsComponent implements OnInit {
  11. selectedSegment: string = 'forum';
  12. heading: string;
  13. routeSubscription: Subscription;
  14. selectedChapter: number = 1;
  15. showMorePostOptions: boolean = false;
  16. selectedPost: number;
  17. constructor(
  18. private route: ActivatedRoute,
  19. private location: Location
  20. ) { }
  21. ngOnInit(): void {
  22. this.routeSubscription = this.route.params.subscribe((params) => {
  23. this.heading = params['heading'];
  24. });
  25. }
  26. ngOnDestroy() {
  27. this.routeSubscription.unsubscribe();
  28. }
  29. back() {
  30. this.location.back();
  31. }
  32. }