angular-cn/public/docs/_examples/cb-dynamic-form/ts/app/app.component.ts

25 lines
580 B
TypeScript
Raw Normal View History

// #docregion
import { Component } from '@angular/core';
2016-06-12 18:41:33 -04:00
import { DynamicFormComponent } from './dynamic-form.component';
import { QuestionService } from './question.service';
@Component({
selector: 'my-app',
template: `
<div>
<h2>Job Application for Heroes</h2>
<dynamic-form [questions]="questions"></dynamic-form>
</div>
`,
2016-06-12 18:41:33 -04:00
directives: [DynamicFormComponent],
providers: [QuestionService]
})
export class AppComponent {
questions: any[];
constructor(service: QuestionService) {
this.questions = service.getQuestions();
}
}