Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70909

Angular lost the most important thing, the binding?

$
0
0

@marciusbezerra wrote:

I would like to know what happened with the binding of Angular that I thought was the most important, in the code below, if I modify the array item, there is no more bind and if I put emails[i] what I already think kinda ugly, the input loses focus with each digit. Thanks!

app.component.html

<div>
  <ul>
    <li *ngFor="let email of emails; let i = index; trackBy:trackByfn">
      <input [(ngModel)]="email">
    </li>
  </ul>
  <span>{{ emails | json }}</span>
</div>

app.component.ts

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {

  emails: string[] = ['test@mail.com'];

}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70909

Trending Articles