私はこれに新しく、私はチュートリアルに従っています。私のコードは働いているチュートリアルのビデオとはまったく同じですが、私のコードはありません。私は「名前 『約束』を見つけることができませんエラーになっていると私は、その理由を把握することはできません。誰もが、私はこのエラーを取得しています理由のアイデアを持っていますか?名前が見つかりませんPromise Angular2
import {Control} from 'angular2/common'
export class UsernameValidators{
static shouldBeUnique(control: Control){
return new Promise ((resolve) => {
setTimeout(function(){
if(control.value == "andy")
resolve({shouldBeUnique: true})
else
resolve(null);
}, 1000);
});
}
static cannotContainSpace(control: Control){
if (control.value.indexOf(' ') >=0)
return {cannotContainSpace: true};
return null;
}
}
tsconfigでES6をターゲットに設定していますか? – NPhillips