{"id":455,"date":"2018-11-01T12:35:01","date_gmt":"2018-11-01T12:35:01","guid":{"rendered":"http:\/\/www.ipraxa.com\/blog\/?p=455"},"modified":"2023-07-05T13:16:08","modified_gmt":"2023-07-05T13:16:08","slug":"angular-7-features-improvements","status":"publish","type":"post","link":"https:\/\/www.ipraxa.com\/blog\/angular-7-features-improvements\/","title":{"rendered":"Angular 7 &#8211; Let\u2019s Know About the New Features and Improvements"},"content":{"rendered":"<p align=\"justify\">Owing to its unmatched efficiency, flexibility, and extensibility, Angular has been one of the <a href=\"https:\/\/www.ipraxa.com\/blog\/popular-javascript-frameworks\/\">most popular JavaScript frameworks<\/a> for developing single-page web and mobile applications. Since its release back in 2010, it has undergone\u00a0several upgrades, each of which has improved the framework in some way or another.<\/p>\n<p align=\"justify\">As a recent instance, while the dust has not yet settled on the <a href=\"https:\/\/www.ipraxa.com\/blog\/angular-6-new-compelling-features\/\">release of Angular 6<\/a>, the Angular team is back again with a new version of the framework, named Angular 7. Unlike the previous version that was mainly focused on making the framework smaller and faster, Angular 7 emphasizes primarily on improving the speed and performance of the platform.<\/p>\n<p align=\"justify\">As a prominent web development company, we love to keep ourselves updated with the <a href=\"https:\/\/www.ipraxa.com\/blog\/web-development-trends\/\">latest trends in web development<\/a> and therefore decided to dedicate a post about Angular 7. So without further ado, let\u2019s check out what\u2019s new and exciting in Angular 7.<\/p>\n<h2 align=\"center\">#CLI Prompts<\/h2>\n<p align=\"justify\">The Angular team has been consistently working on improving its toolchain and the new CLI Prompts are no different. In Angular 7, the CLI responds with prompts when developers run commands such as ng new and ng add. This improvement has been brought to help developers leverage built-in features like routing, SCSS support, and more. The new CLI now even lets you select between SCSS, SASS, LESS, and Stylus.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-457\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-1.png\" alt=\"Angular 7 Features\" width=\"845\" height=\"210\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-1.png 845w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-1-300x75.png 300w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-1-768x191.png 768w\" sizes=\"(max-width: 845px) 100vw, 845px\" \/><\/p>\n<p align=\"justify\">Additionally, the Angular 7 team has also integrated CLI Prompts with <a href=\"https:\/\/blog.angular.io\/schematics-an-introduction-dc1dfbc2a2b2\" target=\"_blank\" rel=\"nofollow noopener\">Angular Schematics<\/a> so that you can create your own custom CLI prompts. All you need to is simply add a <span style=\"background-color: #f2f2f2;\"><em>schematic.json<\/em><\/span> file containing the <span style=\"background-color: #f2f2f2;\"><em>x-prompt<\/em><\/span> key to instruct the Angular 7 CLI to display or hide specific CLI prompts. Here is the code that you need to put in your Angular 7 <span style=\"background-color: #f2f2f2;\"><em>schematic.json<\/em><\/span> file:<\/p>\n<pre class=\"lang:default decode:true \">\"routing\": {\n  \"type\": \"boolean\",\n  \"description\": \"Generates a routing module.\",\n  \"default\": false,\n  \"x-prompt\": \"Would you like to add Angular routing?\"\n},<\/pre>\n<h2 align=\"center\">#Application Performance<\/h2>\n<p align=\"justify\">Since the <a href=\"https:\/\/www.ipraxa.com\/about.html\">development team<\/a> at Google has always been passionate about\u00a0improving the performance of the framework, they have introduced two major changes in Angular 7:<\/p>\n<h3>Removal of the reflect-metadata polyfill:<\/h3>\n<p align=\"justify\">After noticing a large number of developers were using <span style=\"background-color: #f2f2f2;\"><em>reflect-metadata<\/em><\/span> polyfill in production builds, the team Google has decided to automatically remove this polyfill from the <span style=\"background-color: #f2f2f2;\"><em>polyfills.ts<\/em><\/span> file in Angular 7. Given that the <span style=\"background-color: #f2f2f2;\"><em>reflect-metadata<\/em><\/span> polyfill is only required in development, the file will be automatically included as a build step when you build your Angular 7 app in JIT mode.<\/p>\n<h3>Ability to Set Budgets for New Apps:<\/h3>\n<p align=\"justify\">In Angular 7, the size of a new project gets restricted through Bundle Budgets by default. As soon as your initial bundle size reaches 2MB, you start getting warnings and errors when it has a size of 5MB.<\/p>\n<p align=\"justify\">Need a little more space? You can easily change these default settings to suit your Angular 7 project through the <span style=\"background-color: #f2f2f2;\"><em>angular.json<\/em><\/span> file containing the following code:<\/p>\n<pre class=\"lang:default decode:true \">\"budgets\": [{\n  \"type\": \"initial\",\n  \"maximumWarning\": \"2mb\",\n  \"maximumError\": \"5mb\"\n}]<\/pre>\n<p align=\"justify\">If you\u2019re the one who uses Chrome\u2019s <a href=\"https:\/\/support.google.com\/chrome\/answer\/2392284\" target=\"_blank\" rel=\"nofollow noopener\">Data Saver<\/a> feature in <a href=\"https:\/\/www.ipraxa.com\/mobile-app-development.html\">Angular Application Development<\/a>, you can take advantage of Bundle Budgets to optimize network data usage of your application.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-458\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-2.png\" alt=\"Angular 7 Features\" width=\"638\" height=\"78\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-2.png 638w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-2-300x37.png 300w\" sizes=\"(max-width: 638px) 100vw, 638px\" \/><\/p>\n<h2 align=\"center\">#Minor Updates to Angular Material<\/h2>\n<p align=\"justify\">In an attempt to align with the <a href=\"https:\/\/m3.material.io\/\" target=\"_blank\" rel=\"nofollow noopener\">updated specification of Material Design<\/a>, the Angular 7 introduces minor visual improvements in Angular Material. If you are an avid <a href=\"https:\/\/material.angular.io\/\" target=\"_blank\" rel=\"nofollow noopener\">Angular Material<\/a> user, you should notice minor visual differences reflecting the Material Design refresh in Angular 7.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-459\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-3.png\" alt=\"Angular 7 Features\" width=\"800\" height=\"410\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-3.png 800w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-3-300x154.png 300w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-3-768x394.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p align=\"justify\">Apart from that, to improve the accessibility of your application, Angular 7 allows you to use the native <span style=\"background-color: #f2f2f2;\"><em>&lt; select &gt;<\/em><\/span> element inside of a <span style=\"background-color: #f2f2f2;\"><em><a href=\"https:\/\/material.angular.io\/components\/select\/overview\" target=\"_blank\" rel=\"nofollow noopener\">&lt; mat-form-field &gt;<\/a><\/em><\/span> element. Where the native <span style=\"background-color: #f2f2f2;\"><em>&lt; select &gt;<\/em><\/span> element plays a vital role in improving the performance, accessibility, and usability of your application, on the other hand, the<span style=\"background-color: #f2f2f2;\"><em>\u00a0<a href=\"https:\/\/material.angular.io\/components\/select\/overview\" target=\"_blank\" rel=\"nofollow noopener\">&lt; mat-select &gt;<\/a><\/em><\/span> element provides you full control over how you present options. Both <span style=\"background-color: #f2f2f2;\"><em>&lt; select &gt;<\/em><\/span> and <span style=\"background-color: #f2f2f2;\"><em>&lt; mat-select &gt;<\/em><\/span> can now be used inside of <span style=\"background-color: #f2f2f2;\"><em>&lt; mat-form-field &gt;<\/em><\/span> label in Angular 7.<\/p>\n<h2 align=\"center\">#New Additions to the Component Dev Kit (CDK)<\/h2>\n<p align=\"justify\">The Component Dev Kit, which is a part of the Angular Material library, also received some new handy features as part of Angular 7 update. The two new features that have been added to the Angular 7 CDK are:<\/p>\n<h3>Virtual Scrolling:<\/h3>\n<p align=\"justify\">Be it Facebook, Twitter, Instagram, or any other platform, the world\u2019s prominent web applications are full of lists that deal with a large amount of data. Such lists can consume a lot of memory on user\u2019s browsers unless they\u2019re well-optimized by their developers.<\/p>\n<p align=\"justify\">Given that many popular mobile frameworks, like Ionic, are now taking advantage of Virtual Scrolling to dynamically load heavy data such as images or long lists, the Angular 7 team has added a new element, <a href=\"https:\/\/material.angular.io\/cdk\/scrolling\/overview\" target=\"_blank\" rel=\"nofollow noopener\">ScrollingModule<\/a>, to the CDK. Below is the code that you have to include in your app.html file:<\/p>\n<pre class=\"lang:default decode:true \">&lt;cdk-virtual-scroll-viewport itemSize=\"50\" class=\"example-viewport\"&gt;\n  &lt;div *cdkVirtualFor=\"let item of items\" class=\"example-item\"&gt;{{item}}&lt;\/div&gt;\n&lt;\/cdk-virtual-scroll-viewport&gt;<\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-460\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-4.gif\" alt=\"Angular 7 Features\" width=\"680\" height=\"449\" \/><\/p>\n<p align=\"justify\">Enabling Virtual Loading and Unloading of the items from the DOM on the basis of the visible parts of a list, the ScrollingModule make the scrolling experience extremely fast for users with huge scrollable lists.<\/p>\n<h3>Drag and Drop:<\/h3>\n<p align=\"justify\">With a new <a href=\"https:\/\/material.angular.io\/cdk\/drag-drop\/overview\" target=\"_blank\" rel=\"nofollow noopener\">DragDropModule<\/a> added to the Component Dev Kit in Angular 7, you can now easily create intuitive drag and drop interfaces backed by these nifty features:<\/p>\n<ul>\n<li>Automatic rendering as the user relocates\u00a0individual items<\/li>\n<li>Reordering or sorting lists with the help of moveItemInArray<\/li>\n<li>Transferring items between lists with transferArrayItem<\/li>\n<li>Adding custom drag and drop handlers<\/li>\n<li>Restricting dragging and dropping along X or Y axis<\/li>\n<\/ul>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-462\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-5.gif\" alt=\"Angular 7 Features\" width=\"640\" height=\"314\" \/><\/p>\n<p align=\"justify\">Here is how you can implement Drag and Drop feature in your Angular 7 application:<\/p>\n<h3>Add the following code snippet in app.html file:<\/h3>\n<pre class=\"lang:default decode:true \">&lt;div cdkDropList class=\"list\" (cdkDropListDropped)=\"drop($event)\"&gt;\n  &lt;div class=\"box\" *ngFor=\"let movie of movies\" cdkDrag&gt;{{movie}}&lt;\/div&gt;\n&lt;\/div&gt;<\/pre>\n<h3>Add the following code snippet in app.ts file:<\/h3>\n<pre class=\"lang:default decode:true \">drop(event: CdkDragDrop&lt;string[]&gt;) {\n\tmoveItemInArray(this.movies, event.previousIndex, event.currentIndex);\n  }<\/pre>\n<h2 align=\"center\">#Support for Content Projection<\/h2>\n<p align=\"justify\">While this update may seem to be very small to many developers, the one who professionally uses Angular will understand its true importance and utility. Angular Elements, which was introduced in Angular 6 back in 2017, has started to support content projection for custom elements using web standards in Angular 7.<\/p>\n<pre class=\"lang:default decode:true \">&lt;my-custom-element&gt;This content can be projected!&lt;\/my-custom-element&gt;<\/pre>\n<h2 align=\"center\">#New Partners<\/h2>\n<p align=\"justify\">Since one of the major factors behind the success of Angular is its ever-growing community, the Angular 7 team has partnered up with several recently-launched community projects. These are:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-463\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-6.gif\" alt=\"Angular 7 Features\" width=\"934\" height=\"506\" \/><\/p>\n<p align=\"justify\"><strong>StackBlitz:<\/strong> The Angular team has released <a href=\"https:\/\/stackblitz.com\/edit\/angular-dfoe9t\" target=\"_blank\" rel=\"nofollow noopener\">StackBlitz 2.0<\/a> which now includes the <a href=\"https:\/\/angular.io\/guide\/language-service\" target=\"_blank\" rel=\"nofollow noopener\">Angular Language Service<\/a> and supports multipane editing.<\/p>\n<p align=\"justify\"><strong>Angular Console\u200a:<\/strong> The downloadable <a href=\"https:\/\/nx.dev\/core-features\/integrate-with-editors\" target=\"_blank\">Angular Console<\/a> allows developers to start and rung projects on their respective local machines.<\/p>\n<p align=\"justify\"><strong>NativeScript\u200a:<\/strong> With the introduction of <a href=\"https:\/\/docs.nativescript.org\/code-sharing\/\" target=\"_blank\">NativeScript<\/a> in Angular 7, Angular Developers will now be able to have a single project build for both web and mobile devices.<\/p>\n<p align=\"justify\"><strong>@angular\/fire:<\/strong> <a href=\"https:\/\/github.com\/angular\/angularfire\" target=\"_blank\">AngularFire<\/a>, the official Angular library for Firebase, has its first stable release for Angular along with a new home on npm package manager.<\/p>\n<h2 align=\"center\">#Updated Dependencies<\/h2>\n<p align=\"justify\">In addition to being partnered with community projects that have launched recently, Angular 7 has updated its dependencies on major third-party projects, including <a href=\"https:\/\/www.typescriptlang.org\/docs\/handbook\/release-notes\/typescript-3-1.html\" target=\"_blank\" rel=\"nofollow noopener\">TypeScript 3.1, RxJS 6.3<\/a>, and <a href=\"https:\/\/nodejs.org\/en\/blog\/release\/v10.0.0\" target=\"_blank\" rel=\"nofollow noopener\">Node 10<\/a>\u200a with backward compatibility to <a href=\"https:\/\/nodejs.org\/en\/blog\/release\/v8.0.0\" target=\"_blank\" rel=\"nofollow noopener\">Node 8<\/a>.<\/p>\n<h2 align=\"center\">#Updates to Documentation<\/h2>\n<p align=\"justify\">Since the release of the framework, the Angular team has been constantly working on improving their guides and reference materials, and this is the reason why the <a href=\"https:\/\/angular.io\/docs\" target=\"_blank\" rel=\"nofollow noopener\">Angular Documentation<\/a> gets better with every update. With the release of Angular 7, the Angular CLI is now an <a href=\"https:\/\/angular.io\/cli\" target=\"_blank\" rel=\"nofollow noopener\">official part<\/a> of the Angular Documentation.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-464\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image7.jpg\" alt=\"Angular 7 Features\" width=\"1023\" height=\"448\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image7.jpg 1023w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image7-300x131.jpg 300w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image7-768x336.jpg 768w\" sizes=\"(max-width: 1023px) 100vw, 1023px\" \/><\/p>\n<p align=\"justify\">Moreover, the Angular 7 team added a new Release Information section where you can get information about upcoming <a href=\"https:\/\/angular.io\/guide\/releases\" target=\"_blank\" rel=\"nofollow noopener\">Angular releases<\/a> and <a href=\"https:\/\/angular.io\/guide\/updating\" target=\"_blank\" rel=\"nofollow noopener\">updating your Angular projects<\/a>.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-465\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-8.png\" alt=\"Angular 7 Features\" width=\"619\" height=\"208\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-8.png 619w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image-8-300x101.png 300w\" sizes=\"(max-width: 619px) 100vw, 619px\" \/><\/p>\n<h2 align=\"center\">#Upgrading Your Angular Application to Version 7<\/h2>\n<p align=\"justify\">For detailed information and step-by-step guidance on upgrading your application to Angular 7, you may explore <a href=\"https:\/\/update.angular.io\/\" target=\"_blank\" rel=\"nofollow noopener\">Angular Update Guide<\/a>.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-466\" src=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image9.jpg\" alt=\"Angular 7 Features\" width=\"657\" height=\"758\" srcset=\"https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image9.jpg 657w, https:\/\/www.ipraxa.com\/blog\/wp-content\/uploads\/2018\/11\/Image9-260x300.jpg 260w\" sizes=\"(max-width: 657px) 100vw, 657px\" \/><\/p>\n<p align=\"justify\">However, with the introduction of ng update in v6, upgrading to Angular 7 is now a matter of just one command for most developers.<\/p>\n<pre class=\"lang:default decode:true \">ng update @angular\/cli @angular\/core<\/pre>\n<p align=\"justify\">According to Stephen Fluin, developer advocate for Angular, upgrading to Angular 7 is faster than ever and many apps take less than 10 minutes to update with the above command. Literally a cool thing!<\/p>\n<p align=\"justify\"><em>That\u2019s all about Angular 7! <a href=\"https:\/\/www.ipraxa.com\/contact.html\">Feel free to contact us<\/a> if you are looking for <a href=\"https:\/\/www.ipraxa.com\/angularjs-development.html\">Angular Development Company<\/a> for your next project or have any doubts regarding Angular 7.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Owing to its unmatched efficiency, flexibility, and extensibility, Angular has been one of the most popular JavaScript frameworks for developing single-page web and mobile applications. Since its release back in 2010, it has undergone\u00a0several upgrades, each of which has improved the framework in some way or another. As a recent instance, while the dust has <\/p>\n<p> <a class=\"text-btn read-more\" href=\"https:\/\/www.ipraxa.com\/blog\/angular-7-features-improvements\/\">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":468,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/posts\/455"}],"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=455"}],"version-history":[{"count":21,"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/posts\/455\/revisions"}],"predecessor-version":[{"id":2837,"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/posts\/455\/revisions\/2837"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/media\/468"}],"wp:attachment":[{"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/media?parent=455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/categories?post=455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ipraxa.com\/blog\/wp-json\/wp\/v2\/tags?post=455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}