/** Angular Imports */ import { Injectable } from '@angular/core' ; import { HttpClient , HttpParams } from '@angular/common/http' ; /** rxjs Imports */ import { Observable } from 'rxjs' ; /**
 * Templates service.
 */ @ Injectable ( { providedIn : 'root' } ) export class TemplatesService { param { HttpClient } http constructor ( private http ) { } returns { Observable < any > } getTemplates ( ) { return this . http . get ( '/templates' ) ; } param templateId returns { Observable < any > } getTemplate ( templateId ) { return this . http . get ( `/templates/${ templateId }` ) ; } returns { Observable < any > } getCreateTemplateData ( ) { return this . http . get ( '/templates/template' ) ; } param templateId returns { Observable < any > } getEditTemplateData ( templateId ) { return this . http . get ( `/templates/${ templateId }/template` ) ; } param templateData param templateId returns { Observable < any > } createTemplate ( templateData ) { return this . http . post ( `/templates` , templateData ) ; } param templateData param templateId returns { Observable < any > } updateTemplate ( templateData , templateId ) { return this . http . put ( `/templates/${ templateId }` , templateData ) ; } param templateId returns { Observable < any > } deleteTemplate ( templateId ) { return this . http . delete ( `/templates/${ templateId }` ) ; } }