Angular 2

                                    AngularJs vs Angular 2 

AngularJs
Angular2
ng-model
 <input type="text" ng-model="value"><input>

ngModel
 <input type="text" [(ngModel)]="value"><input>

ng-repeat

<element ng-repeat="a in list or array">
</element>


*ngFor

<element *ngFor="let a of list or array">
</element>

ng-show
<div ng-show="IsShow"></div>

[hidden]
<div [hidden]="!IsShow"></div>

ng-hide
<div ng-show="!IsShow"></div>

[hidden]
<div [hidden]="IsShow"></div>
ng-src
<div ng-src=" ImageURL "></div>

[src]
<div [src]=" ImageURL "></div>
ng-style

<elementname  ng-style="{color:red}"></elementname>

[ngStyle]

<elementname  [ngStyle]="{color:red}"></elementname>
OR

<elementname  [style.color]="{red}"></elementname>

ng-click

<div ng-click="myfun()"></div>
(click)

<div (click)="myfun()"></div>
ng-class

<div ng-class="{'classname':condition}"></div>
[ngClass]

<div [ngClass]="{'classname':condition}"></div>
OR

<div [class.classname]="{condition}"></div>


ng-if

<div ng-if="condition"></div>
*ngIf

<div *ngIf="condition"></div>



9 comments :

  1. Great Article. Thank you for sharing! Really an awesome post for every one.

    IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Project Domains for IT It gives you tips and rules that is progressively critical to consider while choosing any final year project point.

    Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining the authors explore the idea of using Java in Big Data platforms.
    Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai

    ReplyDelete
  2. You will eventually learn to drive, but at the cost of unnecessary pressure and information a little too soon than required. However, if one starts with Python training it would be like learning to drive automatic data science course in india

    ReplyDelete