import { Component , OnInit } from '@angular/core' ; import { ActivatedRoute } from '@angular/router' ; import { DocTemplate } from '../models/cmdb-doctemplate' ; import { CmdbMode } from '../../framework/modes.enum' ; import { DocapiService } from '../docapi.service' ; @ Component ( { selector : 'cmdb-docapi-settings-edit' , templateUrl : './docapi-edit.component.html' , styleUrls : [ './docapi-edit.component.scss' ] } ) export class DocapiEditComponent implements OnInit { public docId : number ; public docInstance : DocTemplate ; public mode : number = CmdbMode . Edit ; constructor ( private docapiService , private route ) { this . route . params . subscribe ( ( id ) => this . docId = id . publicId ) ; } public ngOnInit ( ) { this . docapiService . getDocTemplate ( this . docId ) . subscribe ( ( docInstance ) => this . docInstance = docInstance ) ; } }