Hello All,
I’m attempting to setup a page that allows users to add player names. I’m struggling to get the name field of an to accept an expression. Here is my code:
player-create.html
<ion-content padding>
<div class="block" *ngFor="let player of players">
<ion-item>
<ion-label floating>Player {{ player.number }}</ion-label>
<ion-input type="text" name="{{player.playName}}"></ion-input>
</ion-item>
</div>
player-create.ts
export class PlayerCreatePage {
players: Array<{ number: number, playName: string }> = []
constructor(public navCtrl: NavController){
for(let i = 1; i < 4; i++) {
let content = "play" + i + "name";
this.players.push({ number: i, playName: content })
};
};
When I try to run the code, I get the following error:
Unhandled Promise rejection: Template parse errors:
Can’t bind to ‘name’ since it isn’t a known property of ‘ion-input’.
Any help or advice would be greatly appreciated.
Thank you!