click2.Iを呼び出すときに問題があります。エラーが発生します。ここに私のコードは次のとおりです。ここでclickイベントがangular2で動作しません
<form>
<input ngControl="email" type="email" placeholder="Your email">
<input ngControl="password" type="password" placeholder="Your password">
<button (click)="postData()">Log in</button>
</form>
は私のコンポーネントです:
import {Component} from 'angular2/core';
import {NgForm} from 'angular2/common';
import { Router } from 'angular2/router';
@Component({
selector: 'my-form',
templateUrl: 'app/form.component.html'
})
export class FormComponent {
postData(){}
};
それは私にエラーを与える:
EXCEPTION: Error during evaluation of "click"
'postData()'の内容ですか?それはどこに問題がありますか –
あなたは私の答えに追加したプランナーを再現しようとすることができますか? –