如何将输入值传递给需要在angular2
中自举的组件在bootstrap时,如何将一些值传递给sampleInput?
@NgModule({
declarations: [SampleComponent],
imports : [],
exports : [],
providers : [
], bootstrap : [SampleComponent]
})
export class WrapperAppModule {
}
我的SampleComponent代码是,
@Component({
selector : 'app-sample',
styleUrls: ['./app.sample.css'],
template: `<div>sample app</div>`,
})
export class SampleComponent {
@Input('sampleInput') sampleInput:string;
}