Changes in Angular 2 compared to angular 1
- Ngref= href property binding. Browser module has definition to *ngref. Any directive that changes the directive is known as structural directive
*ngFor - No watchers and No digest cycle
- Binding syntax has been changed
- Property binding is done using [ ]
- Component binding
- Directive binding
- Event binding done using ()
- String interpolation using { }
- Angular 1 used to have around 70 directives. 40 of these directives has been removed
- Service has been reduced to one
More about angular 2
- Every application needs ngModule
- Angular 2 is modular. Every app begins with one angular module
- Es6 modules organize our application into cohesive block of application
- Root Angular modules Import other Angular Modules, Identify components,Pipes and directives, provide services to app root injector, bootstrap a component, class to define the ngmodule
Providers : provides services to app root injector
- A service provides anything our application needs.It often shares data or functions between other Angular features, Provide services to injectors
- Dependency injection is how we provide an instance of a class to another Angular feature.Angular has injector.Injector contains services
- Angular Injects a service into a component
- Angular locates the service in angular injector
- Angular Injects the service into the constructor
- If exists it would use it or it would use a new service
Angular 2 introduced significant changes from Angular 1, including new binding syntax, the removal of watchers and the digest cycle, modular application structure, and a stronger focus on services and dependency injection. These concepts are central to understanding how modern Angular applications organize components and functionality, making an Angular Online Course a useful resource for exploring the framework further.
ReplyDeleteThe discussion of ES6 modules, Angular modules, providers, services, and injectors also shows how application functionality can be organized into cohesive units. Understanding these module concepts alongside TypeScript provides a useful foundation for working with Angular applications through a TypeScript Online Course.
ReplyDelete