因为我从角度“angular2”:“2.0.0-beta.0”变为“angular2”:“2.0.0-beta.8”
创建表单时出现此错误...问题似乎来自输入ngControl:
<div id="global">
<div class="row">
<h2>Créer un compte</h2> </div>
<form (ngSubmit)="register()" [ngFormModel]="userForm">
<input ngControl="email" type="text" id="right-label">
<div class="row">
<div class="small-3 columns">
<md-progress-linear class="md-accent" mode="determinate" [value]="strengthValue"></md-progress-linear>
</div>
</div>
<div class="row">
<button md-raised-button class="md-raised md-primary" type="submit" [disabled]="!userForm.valid">S'incrire</button>
</div>
</form>
</div>
如果我删除此行
<input ngControl="email" type="text" id="right-label">
错误消失了(但显然需要我的表格)
这是我的.ts
的开头import {Component, View} from 'angular2/core';
import {FORM_PROVIDERS,FormBuilder, ControlGroup, Control, Validators} from 'angular2/common';
import {MATERIAL_DIRECTIVES} from 'ng2-material/all';
import {Http, Headers} from 'angular2/http';
import {ValidationService} from '../../services/validation.services';
import {ControlMessages} from './control-messages.component';
import { FORM_DIRECTIVES,NgControl} from 'angular2/common';
@Component({
selector: 'inscription-modal-cmp',
providers: [FORM_PROVIDERS]
})
@View({
templateUrl: './components/inscription-modal/inscription-modal.html',
styleUrls: ['./components/inscription-modal/inscription-modal.css'],
directives: [MATERIAL_DIRECTIVES,ControlMessages,FORM_DIRECTIVES]
})
你知道吗?
如果我使用.dev包.... ,问题也解决了
由于