import {Component, ElementRef, NgZone, OnInit, OnDestroy, ViewChild} from "@angular/core"; import {Router, ActivatedRoute, Params} from "@angular/router"; import {##SERVICE##} from "../../shared/##NAME##/##NAME##.service"; @Component({ selector: "gen-comp-detail-##NAME##", templateUrl: "pages/##NAME##/##NAME##-detail.html", styleUrls: ["pages/##NAME##/##NAME##-common.css", "pages/##NAME##/##NAME##.css"] }) export class ##COMPONENT## implements OnInit, OnDestroy { private sub: any; staticListItem: any; listLoaded = false; constructor(private _listService: ##SERVICE##, private route: ActivatedRoute, private router: Router) {} ngOnInit() { this.sub = this.route.params.subscribe(params => { this.staticListItem = this._listService.getListItem(+params['id']); this.listLoaded = true; }); } ngOnDestroy() { this.sub.unsubscribe(); } goBack() { this.router.navigate(['/##NAME##']); } }