Eckig - Es gibt keine Richtlinie, die mit "exportAs" "ngModel"

Folgenden werden die Dateien in der AngularJS-Projekt. Wie bereits in einigen posts, die ich Hinzugefügt haben:

ngModel name="currentPassword" #currentPassword="ngModel 

in das input-Feld, aber immer noch ein Fehler.

Paket.json

.........
"dependencies": {
        "@angular/common": "^2.3.1",
        "@angular/compiler": "^2.3.1",
        "@angular/core": "^2.3.1",
        "@angular/forms": "^2.3.1",
        "@angular/http": "^2.3.1",
        "@angular/platform-browser": "^2.3.1",
        "@angular/platform-browser-dynamic": "^2.3.1",
        "@angular/router": "^3.3.1",
        "core-js": "^2.4.1",
        "rxjs": "^5.0.1",
        "ts-helpers": "^1.1.1",
        "zone.js": "^0.7.2"
    },
   ...............

change-password.component.html

<form #f="ngForm" [formGroup]="changePasswordForm">
        <div class="form-group">
            <label for="currentPassword">Current Password</label> <input
                placeholder="currentPassword" ngModel name="currentPassword"
                #currentPassword="ngModel" id="currentPassword"
                name="currentPassword" type="text" class="form-control" required
                minlength="6" formControlName="currentPassword">
            </div>
        </div>
        <button class="btn btn-primary" type="submit">Change Password</button>
    </form>

ändern-Passwort.Komponente.ts

import { Component, OnInit } from '@angular/core';
import { FormBuilder, Validators, ControlContainer, FormGroup, FormControl } from '@angular/forms';

@Component({
  selector: 'app-change-password',
  templateUrl: './change-password.component.html',
  styleUrls: ['./change-password.component.css']
})
export class ChangePasswordComponent implements OnInit {

  changePasswordForm;

  constructor(formBuilder: FormBuilder) {
    this.changePasswordForm = formBuilder.group({
      currentPassword: new FormControl('', Validators.compose([Validators.required]))
    });
  }

  ngOnInit() {
  }

}

app.- Modul.ts hat die Importe

............
imports: [
    BrowserModule,
    HttpModule,
    FormsModule,
    ReactiveFormsModule
  ]
...........

Ich erhalte die folgende Fehlermeldung:

Unbehandelte Versprechen Ablehnung: Template-parsing-Fehler:
Es gibt keine Richtlinie, die mit "exportAs" "ngModel" ("urrent Kennwort ]#currentPassword="ngModel" id="currentPassword"
name="currentPassword" type="text" class="form co"): ChangePasswordComponent@5:4 ; Zone: ; Aufgabe: Versprechen.dann ; Wert: SyntaxError {__zone_symbol__Fehler: Fehler: Template-parsing-Fehler:
Es gibt keine Richtlinie, die mit "exportAs" "ngModel" ("urrent Passwo......} Fehler: Template-parsing-Fehler:
Es gibt keine Richtlinie, die mit "exportAs" "ngModel" ("urrent Kennwort ]#currentPassword="ngModel" id="currentPassword"
name="currentPassword" type="text" class="form co"): ChangePasswordComponent@5:4
bei SyntaxError.ZoneAwareError (http://localhost:4200/polyfills.bundle.js:6884:33)
bei SyntaxError.BaseError [Konstruktor] (http://localhost:4200/vendor.bundle.js:64475:16)
an der new SyntaxError (http://localhost:4200/vendor.bundle.js:5727:16)

InformationsquelleAutor Sarath | 2017-05-22

Schreibe einen Kommentar