Skip to main content

Posts

Showing posts with the label Why Angular 2? What are major changes in Angular 2?

Angular 2 @Inject vs. @Injectable [Why @Inject and @Injectable?]

What are the difference between @Inject and @Injectable? @Inject() - Angular 2 Angular 2 @Inject() is a special technique for letting Angular know that a parameter must be injected. Stayed Informed - Why @Injectable() in Angular 2? Example as, import { Inject } from '@angular/core' ; import { Http } from '@angular/http' ; class UserService { users: Array < any > ; constructor ( @ Inject(Http) http: Http ) { //TODO AS PER YOU. } } @Injectable() - Angular 2 @Injectable() marks a class as available to an injector for instantiation. An injector reports an error when trying to instantiate a class that is not marked as @Injectable() . How to use Dependency Injection (DI) correctly in Angular 2? The basics Steps of Dependency injection, 1.       A class with @Injectable() to tell angular 2 that it’s to be injected “UserService”. 2.       A class with a constructor that accepts a ...

What are major changes in Angular 2?

The Angular 2 provides lots off benefits over AngularJs 1. i.e. 1.        Angular 2 have better performance then Angular 1. 2.        Angular 2 is more powerful templating then Angular 1. 3.        Angular 2 provided Lazy loading . 4.        Angular 2 provided simpler APIs. 5.        Easier debugging. 6.        Improvement over Dependency Injection . 7.        Angular 2 is much more testable the Angular 1. 8.        Angular 2 provided to nesting level component. 9.        Angular 2 provided the way that is two or more systems work together as a combined system. For more detail about it. go to below link http://angularjs.blogspot.in/2015/08/angular-1-and-angular-2-coexistence.html Integration...