2016-03-05 17:53:34 -05:00
|
|
|
// #docregion
|
2016-06-07 19:06:25 -04:00
|
|
|
import { Component } from '@angular/core';
|
2016-05-03 08:06:32 -04:00
|
|
|
|
2016-06-12 18:41:33 -04:00
|
|
|
import { DynamicFormComponent } from './dynamic-form.component';
|
2016-05-03 08:06:32 -04:00
|
|
|
import { QuestionService } from './question.service';
|
2016-03-05 17:53:34 -05:00
|
|
|
|
|
|
|
@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],
|
2016-03-05 17:53:34 -05:00
|
|
|
providers: [QuestionService]
|
|
|
|
})
|
|
|
|
export class AppComponent {
|
2016-06-07 19:06:25 -04:00
|
|
|
questions: any[];
|
2016-03-05 17:53:34 -05:00
|
|
|
|
|
|
|
constructor(service: QuestionService) {
|
|
|
|
this.questions = service.getQuestions();
|
|
|
|
}
|
|
|
|
}
|