{"id":377,"date":"2018-10-04T12:47:53","date_gmt":"2018-10-04T12:47:53","guid":{"rendered":"http:\/\/www.ipraxa.com\/blog\/?p=377"},"modified":"2023-07-05T13:13:26","modified_gmt":"2023-07-05T13:13:26","slug":"angular-6-new-compelling-features","status":"publish","type":"post","link":"https:\/\/www.ipraxa.com\/blog\/angular-6-new-compelling-features\/","title":{"rendered":"Angular 6 &#8211; New Compelling Features You&#8217;ll Love to Use"},"content":{"rendered":"<p align=\"justify\"><a href=\"https:\/\/angular.io\/\">Angular<\/a>, Google\u2019s popular JavaScript-based framework for building single-page web and mobile applications, has been creating buzz among developers ever since its first release back in September 2016. While Angular 5, the previous major version of Angular, was released by the end of 2017, the search engine giant recently launched Angular 6 &#8211; the latest and first major release of the framework in the year 2018.<\/p>\n<p align=\"justify\">Unlike the previous versions of Angular, which were mainly focused on the underlying framework, Angular 6 rather focuses on the toolchain to make the framework even further smaller, faster and easier to use. Let\u2019s check out some of the new features and improvements that Angular 6 has to offer.<\/p>\n<h2 align=\"center\">#New CLI Commands<\/h2>\n<p align=\"justify\">The Angular CLI gets two major new commands, <strong>ng update<\/strong> and <strong>ng add<\/strong>, with the release of Angular 6. Let\u2019s examine these two new commands in detail.<\/p>\n<h3>ng update<\/h3>\n<p align=\"justify\"><span style=\"background-color: #f2f2f2;\">ng update &lt;package&gt;\u00a0<\/span>analyzes your package.json file and recommend available updates to your Angular 6 application accordingly. For example, running the command <span style=\"background-color: #f2f2f2;\">ng update @angular\\core<\/span> will update all the packages of the Angular 6 framework as well as TypeScript and RxJS and will run any schematics available on these packages to keep your Angular 6 application up to date.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-378\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-1.png\" alt=\"Angular 6: ng update\" width=\"677\" height=\"288\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-1.png 677w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-1-300x128.png 300w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-1-423x180.png 423w\" sizes=\"(max-width: 677px) 100vw, 677px\" \/><\/p>\n<h3>ng add<\/h3>\n<p align=\"justify\"><span style=\"background-color: #f2f2f2;\">ng add &lt;package&gt;<\/span> is another new CLI command designed to make it easier for developers to add new capabilities to their Angular 6 projects. For instance, instead of writing multiple lines of code, you can now add Angular Material to your projects with a simple command such as <span style=\"background-color: #f2f2f2;\">ng add @angular\/material<\/span>.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-379\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-2.png\" alt=\"Angular 6: ng add\" width=\"671\" height=\"291\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-2.png 671w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-2-300x130.png 300w\" sizes=\"(max-width: 671px) 100vw, 671px\" \/><\/p>\n<h2 align=\"center\">#Angular Elements<\/h2>\n<p align=\"justify\">Starting with Angular 6, you\u2019ll be able to dynamically bootstrap Angular components and embed them as native Custom Elements into your other existing Angular 6 projects. This new features not only gives developers a golden opportunity to define new HTML elements in a framework-agnostic manner but also eliminates the requirement of manually bootstraping Angular 6 elements found in static HTML content.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-380\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-3.png\" alt=\"Angular 6 Elements\" width=\"671\" height=\"291\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-3.png 671w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-3-300x130.png 300w\" sizes=\"(max-width: 671px) 100vw, 671px\" \/><\/p>\n<h2 align=\"center\">#New CDK Components<\/h2>\n<p align=\"justify\"><a href=\"https:\/\/material.angular.io\/cdk\">CDK<\/a>, which stands for Component Dev Kit, is already a part of the <a href=\"https:\/\/material.angular.io\/\">Angular Material<\/a> library which offers more than 30 UI components. The main objective of CDK is to empower developers to build their very own library of custom UI components without having to re-invent the wheel.<\/p>\n<p align=\"justify\">With the release of Angular 6, there are some new components that have been added to the Angular Material library:<\/p>\n<h3>Tree<\/h3>\n<p align=\"justify\">Available in both styled (mat-tree) and unstyled (cdk-tree) versions, the new tree component is best suited for displaying hierarchical data.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-381\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-4.png\" alt=\"Angular 6: Tree Component\" width=\"271\" height=\"412\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-4.png 271w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-4-197x300.png 197w\" sizes=\"(max-width: 271px) 100vw, 271px\" \/><\/p>\n<h3>Badge<\/h3>\n<p align=\"justify\">This component, which consists of a small circle, can be used to display a small piece of information such as unread item counts, missed item counts, etc.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-382\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-5.png\" alt=\"Angular 6: Badge Component\" width=\"392\" height=\"206\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-5.png 392w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-5-300x158.png 300w\" sizes=\"(max-width: 392px) 100vw, 392px\" \/><\/p>\n<h3>Bottom-Sheet<\/h3>\n<p align=\"justify\">This component is a special type of mobile-centric dialog that can be used to display a list of options for a particular action from the bottom of the viewport.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-383\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-6.png\" alt=\"Angular 6: Bottom-Sheet Component \" width=\"988\" height=\"623\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-6.png 988w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-6-300x189.png 300w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-6-768x484.png 768w\" sizes=\"(max-width: 988px) 100vw, 988px\" \/><\/p>\n<h3>Overlay<\/h3>\n<p align=\"justify\">The <span style=\"background-color: #f2f2f2;\">@angular\/cdk\/overlay<\/span> package has been updated with a new positioning logic to help developers create intelligent pop-ups that stay on the screen in all situations.<\/p>\n<h2 align=\"center\">#Angular Material Starter Components<\/h2>\n<p align=\"justify\">With Angular 6, you\u2019ll be able to generate 3 new starter components right after you run <span style=\"background-color: #f2f2f2;\">ng add @angular\/material<\/span> to add material components to your existing Angular 6 project.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-384\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Angular-Material-Starter-Components.gif\" alt=\"Angular Material Starter Components\" width=\"1261\" height=\"660\" \/><\/p>\n<p align=\"justify\">These components are:<\/p>\n<h3>Material Sidenav<\/h3>\n<p align=\"justify\">By Running the <span style=\"background-color: #f2f2f2;\">ng generate @angular\/material:material-nav &#8211;name=my-nav<\/span> command, you can generate a starter component that includes a toolbar with the app name and the side navigation.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-385\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-7.png\" alt=\"Angular 6: Material Sidenav\" width=\"800\" height=\"418\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-7.png 800w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-7-300x157.png 300w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-7-768x401.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<h3>Material Dashboard<\/h3>\n<p align=\"justify\">Run <span style=\"background-color: #f2f2f2;\">ng generate @angular\/material:material-dashboard &#8211;name=my-dashboard<\/span> command to generate a starter dashboard component that contains a dynamic grid list of cards.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-386\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-8.png\" alt=\"Angular 6: Material Dashboard\" width=\"800\" height=\"424\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-8.png 800w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-8-300x159.png 300w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-8-768x407.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<h3>Material Data Table<\/h3>\n<p align=\"justify\">To generate a starter data table component pre-configured with a datasource for the purpose of sorting and pagination, you can run this command <span style=\"background-color: #f2f2f2;\">ng generate @angular\/material:material-table &#8211;name=my-table<\/span>.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-387\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-9.png\" alt=\"Angular 6: Material Data Table\" width=\"800\" height=\"427\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-9.png 800w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-9-300x160.png 300w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-9-768x410.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<h2 align=\"center\">#CLI Workspaces<\/h2>\n<p align=\"justify\">The Angular CLI now supports the creation of workspaces. Each workspace can have multiple Angular 6 projects, each project can have targets and each target can have configurations. Additionally, instead of .angular-cli.json, the Angular CLI will now use a renamed file angular.json for build and project configuration.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-388\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-10.png\" alt=\"Angular 6: CLI Workspaces\" width=\"705\" height=\"485\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-10.png 705w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-10-300x206.png 300w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><\/p>\n<h2 align=\"center\">#Library Generation Support<\/h2>\n<p align=\"justify\">Starting with Angular 6, the CLI allows developers to create and build libraries in an existing workspace. You can now easily create a library using the <span style=\"background-color: #f2f2f2;\">new ng generate library &lt;name&gt;<\/span> CLI command.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-389\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-11.gif\" alt=\"Angular 6: CLI Workspaces\" width=\"1261\" height=\"660\" \/><\/p>\n<h2 align=\"center\">#Tree Shakable Providers<\/h2>\n<p align=\"justify\">Tree shaking is Google\u2019s build optimization attempt to ensure any unused code will not be included in the final bundle. Instead of \u2018modules referencing services\u2019, Angular 6 now uses \u2018services referencing modules\u2019 to make your applications smaller and faster.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-390\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-12.png\" alt=\"Library Generation Support\" width=\"1199\" height=\"593\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-12.png 1199w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-12-300x148.png 300w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-12-768x380.png 768w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-12-1024x506.png 1024w\" sizes=\"(max-width: 1199px) 100vw, 1199px\" \/><\/p>\n<h2 align=\"center\">#Animations Performance Improvements<\/h2>\n<p align=\"justify\">With the release of Angular 6, developers are no longer required to use the web animations polyfill. This means developers can now remove this polyfill from their Angular 6 project and save approximately 47KB of bundle size, while also increasing the performance of animations in Safari browser at the same time.<\/p>\n<h2 align=\"center\">#RxJS v6<\/h2>\n<p align=\"justify\">Angular 6 uses version 6 of RxJS, which is the latest and updated version of the independent library. This means you can now enjoy the newest features of RxJS 6, like backwards compatibility, in your Angular 6 applications.<\/p>\n<h2 align=\"center\">#Other Notable Changes<\/h2>\n<h3>Removal of &lt; template &gt; Tag<\/h3>\n<p align=\"justify\">While the <span style=\"background-color: #f2f2f2;\">&lt;template&gt;<\/span> element was depreciated a year ago in Angular 4, it has been removed completely from the Angular 6 framework. Consequently, you have to use a new element <span style=\"background-color: #f2f2f2;\">&lt;ng-template&gt;<\/span> instead.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-391\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-13.png\" alt=\"Angular 6: TypeScript\" width=\"664\" height=\"106\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-13.png 664w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/10\/Image-13-300x48.png 300w\" sizes=\"(max-width: 664px) 100vw, 664px\" \/><\/p>\n<h3>TypeScript 2.7+ Support:<\/h3>\n<p align=\"justify\">To make coding easier, Angular 6 supports TypeScript 2.7 and all its subsequent versions, with features like conditional type declarations, strict class initialization, and default declarations.<\/p>\n<p align=\"justify\"><em>That\u2019s all about Angular 6! For information and guidance on upgrading your application to Angular 6, you may visit <a href=\"https:\/\/update.angular.io\/\">Angular Update Guide<\/a>. Feel free to <a href=\"https:\/\/www.ipraxa.com\/contact.html\">contact us<\/a>\u00a0if you have any query regarding <a href=\"https:\/\/www.ipraxa.com\/angularjs-development.html\">Angular website and application development<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Angular, Google\u2019s popular JavaScript-based framework for building single-page web and mobile applications, has been creating buzz among developers ever since its first release back in September 2016. While Angular 5, the previous major version of Angular, was released by the end of 2017, the search engine giant recently launched Angular 6 &#8211; the latest and <\/p>\n<p> <a class=\"text-btn read-more\" href=\"https:\/\/www.ipraxa.com\/blog\/angular-6-new-compelling-features\/\">Read More <svg xml:space=\"preserve\" enable-background=\"new 0 0 30 18\" viewBox=\"0 0 30 18\" height=\"18px\" width=\"30px\" y=\"0px\" x=\"0px\" xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M20.305,16.212c-0.407,0.409-0.407,1.071,0,1.479s1.068,0.408,1.476,0l7.914-7.952c0.408-0.409,0.408-1.071,0-1.481\n\n\n\nl-7.914-7.952c-0.407-0.409-1.068-0.409-1.476,0s-0.407,1.071,0,1.48l7.185,7.221L20.305,16.212z\" class=\"handle\"\/><path d=\"M1,8h28.001c0.551,0,1,0.448,1,1c0,0.553-0.449,1-1,1H1c-0.553,0-1-0.447-1-1\n\n\n\nC0,8.448,0.447,8,1,8z\" clip-rule=\"evenodd\" fill-rule=\"evenodd\" class=\"bar\"\/><\/svg><\/a><\/p>\n","protected":false},"author":4,"featured_media":395,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[40,41,42,43],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/posts\/377"}],"collection":[{"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/comments?post=377"}],"version-history":[{"count":12,"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/posts\/377\/revisions"}],"predecessor-version":[{"id":2832,"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/posts\/377\/revisions\/2832"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/media\/395"}],"wp:attachment":[{"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/media?parent=377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/categories?post=377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/tags?post=377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}