Angular 角2分量作为属性
我想知道:如何绑定模板中选择器使用的组件的值和模型中声明的对象 FormComponent为选择器“interface form”指定了一个值 代码如下:Angular 角2分量作为属性,angular,Angular,我想知道:如何绑定模板中选择器使用的组件的值和模型中声明的对象 FormComponent为选择器“interface form”指定了一个值 代码如下: @Component({ moduleId: 'module.id', selector: 'create-interface', template: ' <div class="content" style="margin : 20px;"> <div class="header-section r
@Component({
moduleId: 'module.id',
selector: 'create-interface',
template: '
<div class="content" style="margin : 20px;">
<div class="header-section row">
<button class="btn"> < Retour</button>
</div>
<interface-form [data]="data" [dataFields]="this.form.dataFields">
</interface-form>
</div>'
})
export class CreateComponent {
public form: FormComponent;
...
@组件({
moduleId:'module.id',
选择器:“创建接口”,
模板:'
我希望我的表单属性是在模板中声明的接口表单的实例,因此如果我这样做:
此.form.addField(…),我的模板将动态更改。我想您要查找的是
FormArray
。请查看:
在哪里必须使用属性绑定值?