Although not directly related to coding, the syntax in AngularJS can still be followed:
<input ng-model="hero.name" placeholder="name" type="text">
Here is an example of the syntax used in Angular 2 and its newer versions:
<input [(ngModel)]="hero.name" placeholder="name" type="text">
Implementing these changes would greatly benefit those transitioning from Angular JS.
Similarly, for ng-repeat
, the syntax has changed to ngFor
:
<ul ngFor let-item [ngForOf]="items" let-i="index" [ngForTrackBy]="trackByFn">
<li>...</li>
</ul>
<ul ng-repeat="item in items track by myTrackingFunction(n)">
<li>...</li>
</ul>