What are the differences between Angular 5 and Angular 6. How can I update our application from Angular 5 to Angular 6.
What are the major differences between Angular 5 and Angular 6?
What are the differences between Angular 5 and Angular 6. How can I update our application from Angular 5 to Angular 6.
What are the major differences between Angular 5 and Angular 6?
Angular 6 Changes :
1) Typescript 2.7+ supports
2) Added Angular Material and CDK Stable
3) Component Dev Kit (CDK) - CDK allows you to build your own library of UI components using Angular Material.
4) Improved decorator error messages
5) Fix platform-detection example for Universal
6) Ivy Renderer - It is a new backward compatible and main focused area - speed improvements, size reduction, and increased flexibility.
7) Add afterContentInit and afterContentChecked to render
8) Added to supports of nativeElement
9) Added Optional generic type for ElementRef The Example looks like - @ViewChild('your-element') yourElement:ElementRef;
10) Bazel Compiler - Bazel only rebuilds what is necessary.
11) Added Test Comment
12) Add missing lifecycle tests for projected components
13) Closure Compiler - Closure Compiler consistently generates smaller bundles.
14) Rename QueryPredicate to LQuery and LQuery to LQueries
15) Service Worker - Service worker is a script that runs in the web browser. It also manages caching for an application.
16) Added multiple validators for array method of FormBuilder
17) Handle string with and without line boundary - Now Handle string with and without line boundary (^ & $) on pattern validators. Previously, it works with string not boundaries.
18) AbstractControl statusChanges - Previous version, not emits an event when you called “markAsPending” but now emits an event of "PENDING" when we call AbstractControl markAsPending.
19) Updates on NgModelChange - Now emitted after value and validity is updated on its control. Previously, it was emitted before updated.
20) Allow HttpInterceptors to inject HttpClient – Previously, an interceptor attempting to inject HttpClient directly would receive a circular dependency error, as HttpClient was constructed via a factory which injected the interceptor instances. Users want to inject HttpClient into interceptors to make supporting.
Either HttpClient or the user has to deal specially with the circular Dependency. This change moves that responsibility into HttpClient itself. By utilizing a new class HttpInterceptingHandler which lazily Loads the set of interceptors at request time, it's possible to inject HttpClient directly into interceptors as construction of HttpClient no longer requires the interceptor chain to be constructed.
21) Add navigationSource and restoredState to NavigationStart – Currently, NavigationStart there is no way to know if navigation was triggered imperatively or via the location change. These two use cases should be handled differently for a variety of use cases (e.g., scroll position restoration). This PR adds a navigation source field and restored navigation id (passed to navigations triggered by a URL change).
22) Add type and hooks to directive def
23) Enable size tracking of a minimal CLI render3 application
24) Add canonical view query
25) Language Service – The 2.6 version of Typescript’s “resolveModuleName” started to require paths passed to be separated by '/' instead of being able to handle '\'.
For More Details : Click Here
You can update your angular 5 app to angular v6, refer this url http://www.talkingdotnet.com/upgrade-angular-5-app-angular-6-visual-studio-2017/
Also you can see the major changes between angular 5 and angular 6, https://dzone.com/articles/angular-6-release-vs-angular-5-new-features-and-im
In Angular 6, By default, this decorator is configured with a "providedIn" property, which creates a provider for the service. In this case, providedIn: 'root' specifies that the service should be provided in the root injector.
@Injectable({
providedIn: 'root'
})
export class ApiService{
//.......}
There are major changes from angular 5 to 6, the top 10 changes are listed below:-
For detailed explanation,please refer https://dzone.com/articles/top-10-features-of-angular-60