import {Component} from '@angular/core'; import { {{name}} } from './model.Service'; import { DatePickerOptions, DateModel } from 'ng2-datepicker'; //---------------------------------- // Component for {{name}} // created with Magic code generator //---------------------------------- @Component ({ selector: '{{name}}-form', styleUrls: [ './form.component.css' ], providers: [{{name}}], template: `

{{name}}


{{#each model}} {{#xif "this.type == Date"}}
{{/xif}} {{#xif "this.type == Boolean"}}
{{/xif}} {{#xif "this.type == String || this.type == Number"}}
{{#xif "this.enum == null"}}
{{/xif}} {{#xif "this.enum != null"}}
{{/xif}}
{{/xif}} {{/each}} ` }) export class {{name}}Form { {{#each model}} {{@key}}:"data"; {{/each}} value: any; date: DateModel; options: DatePickerOptions; constructor(private data: {{name}}) { this.options = new DatePickerOptions(); } saveForm(value: any) { console.log(value); this.data.save(value); } }