Advertisement
Guest User

about.page.ts

a guest
Oct 14th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import { Component, OnInit, OnDestroy } from "@angular/core";
  2. import { AboutService } from "./about.service";
  3. import { Subscription } from "rxjs";
  4.  
  5. @Component({
  6. selector: "app-about",
  7. templateUrl: "./about.page.html",
  8. styleUrls: ["./about.page.scss"]
  9. })
  10. export class AboutPage implements OnInit, OnDestroy {
  11. about: string;
  12. private aboutSubs: Subscription;
  13.  
  14. constructor(private aboutService: AboutService) {}
  15.  
  16. ngOnInit() {
  17. this.aboutSubs = this.aboutService.showAbout().subscribe(data => {
  18. this.about = data.section[0].text.div;
  19. });
  20. }
  21.  
  22. ngOnDestroy() {
  23. if (this.aboutSubs) {
  24. this.aboutSubs.unsubscribe();
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement