R
R
reactreact2016-01-21 13:14:53
JavaScript
reactreact, 2016-01-21 13:14:53

How to change data on a page in angular2?

Initially, in this.name = "petya", I accept json from the server, let's say the name is "vasya", then I assign it to this.name, but nothing changes on the page.
Input is like this:

<input type="text" [ngModel]="name " (ngModelChange)="name=$event">

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PerfectLab, 2016-01-21
@PerfectLab

Try like this<input type="text" [(ngModel)]="name"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question