これは、HTMLを再構成した後this question.Angularを使用すると、どのようにngmodelを関数に渡すことができますか?
のフォローアップで、私は今、機能sendinvite()
に、具体的emailinputs.email
、ngmodelを渡すことで立ち往生しています。
新しいHTMLは次のとおりです。エラーがemailinputs.email結果を使用して
export class InvitePage {
emailinputs = [{'id' : 'row0', 'name' : 'row0', 'email': ''}];
sendinvite(emailinputs.email) {
if (this.emailinputs.email==null || this.emailinputs.email=="" || !this.emailinputs.email.includes("@") || !this.emailinputs.email.includes("."))
{
let alert = this.alerCtrl.create({
title: 'Error!',
message: 'There was an error with an email address you entered.',
buttons: ['Ok']
});
alert.present()
}
else {
this.emailComposer.isAvailable().then((available: boolean) =>{
if(available) {
}
});
let email = {
to: this.emailinputs.email,
attachments: [],
subject: 'Nudget Invite',
body: '<a href="">Join my grocery list!</a>',
isHtml: true
};
this.emailComposer.open(email); }
}
}
と私はなぜわからない:関数の
<ion-content>
<ion-item id="row" *ngFor="let emailinput of emailinputs ; let i = index">
<ion-label>
Email
</ion-label>
<ion-input type="email" id="email" placeholder="[email protected]" (keyup.enter)="Send($event.target.value)" [(ngModel)]="emailinputs[i].email"></ion-input>
</ion-item>
<div padding>
<button (click) = "addnewemail()" id="register" ion-button full color="nudgetprim" block>Add</button>
<button (click) = "sendinvite(emailinput.email)" id="sendinvite" ion-button full color="nudgetprim" block>Invite</button>
</div>
</ion-content>
活字体です。
this.emailinputsあなたはブークレ私は謝罪 – Fetrarij