Home:ALL Converter>Differences Between Angular 5 and Angular 6

Differences Between Angular 5 and Angular 6

Ask Time:2018-06-06T20:35:14         Author:zeeshan Qurban

Json Formatter

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?

Author:zeeshan Qurban,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/50720563/differences-between-angular-5-and-angular-6
Kishore Thangapandi :

Angular 6 Changes :\n\n1) Typescript 2.7+ supports\n\n2) Added Angular Material and CDK Stable\n\n3) Component Dev Kit (CDK) - CDK allows you to build your own library of UI components using Angular Material.\n\n4) Improved decorator error messages\n\n5) Fix platform-detection example for Universal\n\n6) Ivy Renderer - It is a new backward compatible and main focused area - speed improvements, size reduction, and increased flexibility.\n\n7) Add afterContentInit and afterContentChecked to render\n\n8) Added to supports of nativeElement\n\n9) Added Optional generic type for ElementRef\nThe Example looks like -\n@ViewChild('your-element') yourElement:ElementRef;\n\n10) Bazel Compiler - Bazel only rebuilds what is necessary.\n\n11) Added Test Comment\n\n12) Add missing lifecycle tests for projected components\n\n13) Closure Compiler - Closure Compiler consistently generates smaller bundles.\n\n14) Rename QueryPredicate to LQuery and LQuery to LQueries\n\n15) Service Worker - Service worker is a script that runs in the web browser. It also manages caching for an application.\n\n16) Added multiple validators for array method of FormBuilder\n\n17) 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.\n\n18) AbstractControl statusChanges - Previous version, not emits an event when you called “markAsPending” but now emits an event of \"PENDING\" when we call AbstractControl markAsPending.\n\n19) Updates on NgModelChange - Now emitted after value and validity is updated on its control. Previously, it was emitted before updated.\n\n20) Allow HttpInterceptors to inject HttpClient –\nPreviously, 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.\n\nEither 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.\n\n21) 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).\n\n22) Add type and hooks to directive def\n\n23) Enable size tracking of a minimal CLI render3 application\n\n24) Add canonical view query\n\n25) 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 '\\'.\n\nFor More Details : Click Here",
2018-06-28T10:00:23
Ketan Chaudhari :

\nYou can update your angular 5 app to angular v6,\nrefer this url http://www.talkingdotnet.com/upgrade-angular-5-app-angular-6-visual-studio-2017/\nAlso you can see the major changes between angular 5 and angular 6,\nhttps://dzone.com/articles/angular-6-release-vs-angular-5-new-features-and-im\n",
2018-06-22T11:40:23
Yasir Shabbir Choudhary :

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.\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApiService{\n //.......}\n\n\nFurther reference at here",
2018-09-03T18:48:39
yy