<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Angular - Medium]]></title>
        <description><![CDATA[All about Angular ❤ - Medium]]></description>
        <link>https://medium.com/jaafar-madih?source=rss----8c3036dc57e4---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Angular - Medium</title>
            <link>https://medium.com/jaafar-madih?source=rss----8c3036dc57e4---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 00:55:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/jaafar-madih" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Angular 6]]></title>
            <link>https://medium.com/jaafar-madih/angular-6-223dac0358b6?source=rss----8c3036dc57e4---4</link>
            <guid isPermaLink="false">https://medium.com/p/223dac0358b6</guid>
            <dc:creator><![CDATA[Jaafar MADIH]]></dc:creator>
            <pubDate>Tue, 12 Jun 2018 10:02:22 GMT</pubDate>
            <atom:updated>2018-08-09T14:53:22.915Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s talk about the last version of the super framework !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_ZXA26LTHs8aVUo1" /><figcaption>Photo by <a href="https://unsplash.com/@dhaval?utm_source=medium&amp;utm_medium=referral">Dhaval Parmar</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Migrate to Angular 6</h3><p>Theory is good, but practice is better !<br>o start this article we will see how to start or migrate to the v6. Well, Angular create a lot of tools and guides to help developers to configure and create projects faster, what let them focus in other project priorities and challenges. <br>Between all those tools we will find the migration guide :</p><blockquote><a href="https://update.angular.io/">https://update.angular.io/</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*EOJ3jWRJ5sD2QTR1fc36kw.png" /></figure><p>As you see you can put the current project version and the version we want to migrate to.</p><p>You can also precise :</p><blockquote>The app Complexity</blockquote><blockquote>If you use ngUpgrade</blockquote><blockquote>The package manager</blockquote><p>After that you will have a list of steps to follow to make the upgrade easier and faster.</p><h3>CLI:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6fA8vBxVzIMqTW1soIF_Ng.png" /></figure><p>You probably know the famous tool that help us to configure and start an angular project in less than 2 mins ? Yes i’m talking about Angular CLI.</p><p>Well, the magnificent Angular CLI team create other commands to help us with our future migrations.</p><p>This time they jumped from the 1.7 version to 6.0, they decided to align the version with the rest of the framework as what happened with Angular material last time. This version it’s supports only the Angular 5.X, Angular 6.X and not the 2.X or 4.X.</p><p><strong>ng update</strong></p><p>This command show up from the version 1.7. They add some advanced features in this last version.</p><p>First of all, they offer a script to help us to migrate the <strong>@angular/cli</strong> it’s self by using the command below :</p><pre>ng update @angular/cli --migrate-only --from=1.7.4</pre><p>It will update automatically the missing dependencies, adapt the code to the new layout and migrate the configuration file to the new <strong>angular.json.</strong></p><blockquote>For more infomations about the options you can visit : <a href="https://github.com/angular/angular-cli/wiki/update">https://github.com/angular/angular-cli/wiki/update</a></blockquote><p>You can do the same for RxJS :</p><pre>ng update rxjs --migrate-only --from=5.5.9</pre><p><strong>ng add</strong></p><pre>ng add &lt;package&gt;</pre><p>This command make it easy to add a new dependencies to your project and make them ready to use unlike “<strong><em>npm install</em></strong>”. The major difference is the invocation of a script that can change the configuration in angular.json and install other dependencies like polyfills.</p><p><strong>Workspaces</strong></p><p>An Angular Workspace is a directory which is generated via Angular CLI and able to contain multiple projects or libraries that derive the configuration out of a single file.</p><h3>What’s else in Angular 6.x ?</h3><blockquote>Tree Shakable Providers</blockquote><p>We can define it as a step in the build process where angular removes unused code.That way we can make sure that our application contains only the code that she need to run, what can improve the performance.</p><p>To do this, we have a new property <strong>“providedIn”</strong> in the “<strong>@Injectable</strong>” decorator. Instead of importing the module that contains the service, we will tell which module contains the service.</p><h4>This is how to do it:</h4><pre>import { Injectable } from &#39;@angular/core&#39;;<br><br>@Injectable({<br>  <strong>providedIn</strong>: &#39;root&#39;<br>})<br>export class MyService {<br>  constructor() { }<br>}</pre><blockquote>Angular Elements</blockquote><p>What if you wanna use only one component made with Angular into other web application made with Vue.js or React ? <br>Her we are, we can use Angular component as a standard Custum Element that can bootstrap itself and hosted in an NgElement. <br>To do so, you can create a simple component and add it to a module that you can register in an another application made with an other framework.</p><pre>import { createCustomElement } from &#39;@angular/elements&#39;;<br>import { platformBrowserDynamic } from &#39;@angular/platform-browser-dynamic&#39;;<br><br>import { MyComponent, MyModule } from &#39;./my.module&#39;;<br><br>platformBrowserDynamic().bootstrapModule(MyModule)<br>  .then(({ injector }) =&gt; {<br>    const MyElement = createCustomElement(MyComponent, { injector   });<br>    window.customElements.define(&#39;app-jm&#39;, MyElement);<br>  });</pre><blockquote>RxJs 6</blockquote><p>“RxJS 6 brings improvements in modularity, a boost in performance and easier to debug call stacks. The RxJS team has made a solid effort on making this release as backward compatible as possible”</p><p>If you want to migrate from v5 to v6 you should use the package<strong><em> &quot;</em></strong><strong>rxjs-compat&quot; that create compatibility layers between v6 and v5.</strong></p><pre>npm install rxjs@6 rxjs-compat@6 --save</pre><p>Installing this package will allow you to use the existing codebase without issues. But you will see the bundle size of your app increazing, that’s why it’s recommanded to delete the package after the migration process.</p><blockquote>Ivy</blockquote><blockquote>keyvalue pipe</blockquote><blockquote>Router — URI error handler</blockquote><blockquote>Router — URL update strategy</blockquote><blockquote>Router Scroll Position Restoration</blockquote><blockquote>ShadowDOM v1 View Encapsulation</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=223dac0358b6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jaafar-madih/angular-6-223dac0358b6">Angular 6</a> was originally published in <a href="https://medium.com/jaafar-madih">Angular</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>