Angular2: Exception “No provider for t!” when creating a form
问题 <div id="my-form" class="form-inline"> <div class="form-group"> <input type="text" [(ngModel)]="name" ngControl="name" #n="ngForm" required> <div [hidden]="n.valid" class="alert alert-danger"> Value is required </div> </div> </div> I get the following (less than helpful) error with alpha.52: EXCEPTION: No provider for t! (t-> t) 回答1: Angular registers controls under their ngControl names with the NgForm. Normally, you don't have to add the NgForm directive explicitly because it automatically