Angular2 If ngModel is used within a form tag, either the name attribute must be set or the form

前端 未结 14 2306
借酒劲吻你
借酒劲吻你 2020-12-04 07:33

I am getting this error from Angular 2

core.umd.js:5995 EXCEPTION: Uncaught (in promise): Error: Error in app/model_exposure_currencies/model_exposure_cu

14条回答
  •  感动是毒
    2020-12-04 07:55

    You need import { NgForm } from @angular/forms in your page.ts;

    Code HTML:

    ... ...

    In your Page.ts, implement your funcion to manipulate form data:

    function(data) {console.log("Name: "data.value.name + " Mail: " + data.value.mail);}
    

提交回复
热议问题