Why Angular 2 or Angular 4 use banana brackets? Is there any specific reason for that? Why...

Discussão em 'Angular' iniciado por VIKAS KOHLI, Outubro 23, 2024.

  1. VIKAS KOHLI

    VIKAS KOHLI Guest

    I know, it is not related to any coding but they can follow the same syntax as in AngularJS

    <input ng-model="hero.name" placeholder="name" type="text">


    Angular 2 and its Greater Version Syntax till now

    <input [(ngModel)]="hero.name" placeholder="name" type="text">


    If they do so, it would be very helpful for people to adapt change in Angular JS ?

    Similarly for ng-repeat, they 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>

    Continue reading...

Compartilhe esta Página