Angular 2 is the latest framework for building web applications using typescript. Recently, angular team is skipped the version 3.x because, router package is shipped with 3.x previously, so instead of putting into 3.x, choose to move to 4.x.

Tuesday, 18 October 2016

Angular2 is a complete rewrite


In Angular 1.x typical component

Route Of Controller:
$routeProvider.when('/mypage',{
  controller : 'MyAppController',
  templateUrl :'myapp.html'
});


angular.module('myapp').controller('MyAppController', function($scope){

$scope.message = "I am learning angular2 basics to expertise";

})

View mount of controller:

<div ng-controller = "MyAppController">
{{message}}
</div>

In Angular2 :

import { Component } from 'angular2/angular2';
@Component ({
selector :'my-widget',
template: '{{message}}',
imputs: ['message']
})
exports class MyAppClass {
    constructor (public msg: string){
    }
}

0 coment�rios:

Post a Comment

Labels

Online Training

Your Name :
Your Email: (required)
Your Message: (required)

Powered by Blogger.

Recent Posts

Find Us On Facebook

Popular Posts