<?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[Stories by Cagdas Yigit on Medium]]></title>
        <description><![CDATA[Stories by Cagdas Yigit on Medium]]></description>
        <link>https://medium.com/@cagdasyigit?source=rss-e1380b4c627c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*WsM2qvO_E7lb4fcYnnPumg.jpeg</url>
            <title>Stories by Cagdas Yigit on Medium</title>
            <link>https://medium.com/@cagdasyigit?source=rss-e1380b4c627c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 11:43:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cagdasyigit/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Issues I Faced When Upgrading The Angular Versions]]></title>
            <link>https://medium.com/piateamtech/issues-i-faced-when-upgrading-the-angular-versions-99ba8700eb8e?source=rss-e1380b4c627c------2</link>
            <guid isPermaLink="false">https://medium.com/p/99ba8700eb8e</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[version]]></category>
            <category><![CDATA[upgrade]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Cagdas Yigit]]></dc:creator>
            <pubDate>Tue, 06 Jul 2021 08:49:19 GMT</pubDate>
            <atom:updated>2021-07-08T20:01:15.737Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rv62Wh4plO6s-A-2TV0yjg.png" /></figure><p>Hello, I will mention about the complexities and issues I faced when I was updating the Angular projects I work on at my current company in this post. Angular gives you the step by step guide for updating between desired angular versions in this web site: <a href="https://update.angular.io/">https://update.angular.io/</a></p><p>But in this blog I will mention about my own experiences instead of going through these steps one by one. I updated from version 5 to 12. Let’s start.</p><ul><li>Angular material update: It gives errors in some versions of angular material when running update scripts because of the update scripts do not run smoothly in some versions. What I did is updating material after getting everything done. So when I finish with all other updates, I just ran ng update <a href="http://twitter.com/angular/material">@angular/material</a>.</li><li>When I try to update angular version one by one, it gives me dependency version errors, therefore I had to use — force flag. After I done with angular version upgrade, I updated other package versions later. When you finish with both angular core and material updates, follow these steps to update other dependencies:<br> <br> * npm outdated → to check newer versions<br> * npm install -g npm-check-updates → install npm update checker<br> * ncu -u → updates the package.json<br> * check your package.json file and do your necessary adjustments (like downgrades for example)<br> * npm install → to install newer versions</li></ul><p>Some versions of Angular might not work with latest version of typescript.<br>You will need to downgrade typescript version in that case. Also be careful about other possible incompatible packages.</p><ul><li><a href="http://twitter.com/ViewChild">@ViewChild</a> and <a href="http://twitter.com/ContentChild">@ContentChild</a> annotations now requires the second parameter. You should define whetheter if the child component is static or not. Example:</li></ul><pre>@ViewChild(‘someElement’, { static: true }) someElement: HTMLElement;</pre><p>If the element is affected by a structural directive like *ngIf, consider declaring static: false.</p><ul><li>Usage of ngModelChange in reactive forms has deprecated in Angular 6 and removed in Angular 7. I simply converted most of them to change event, but be careful and make sure that you don’t need custom solutions.</li><li>Previously we had to define entry components for dynamic components,<br> now you should remove them from everywhere manually. It’s not used after Angular 9.</li><li>Inputs with number types now can not use change events, it should be switched to input event instead. Unfortunately migrate scripts won’t do this automatically for you.<br> This code:<br> &lt;input type=”number” (change)=”onChange()” /&gt;<br> Now should be like this:<br> &lt;input type=”number” (input)=”onChange()” /&gt;</li><li>Resolve function can not be called with empty parameters in promise objects, it should be called at least with true. Find all empty resolve calls and replace them by resolve(true).</li><li>Be careful for async pipe in html, it no longer triggers any change detection if you use an nested object after expression. For example: (bla$ | async).someAttribute. Changes won’t be updated on someAttribute value change. You might have to trigger changes yourself by using markForCheck method in ChangeDetectorRef. To use that you also need to switch component change detection strategy to OnPush. I recommend to avoid using nested objects and use variables instead if it is something to render. Less trouble!</li><li>Functions are not allowed for environment configuration. It should be a plain object. If you want inject dynamic configurations, consider using APP_INITIALIZER token of Angular. Once you have the data just assign it inside the environment, for example like this:<br>environment.config = dynamicConfigFromWebService;</li><li>If you are using StoreConnectionModule, you should call forRoot method where you import it.</li><li>You have to define node in types array in tsconfig.app.json file.<br> “types”: [ “node” ]</li><li>You might have some issues related to angular compiler options. I had to set some configurations to false in tsconfig.json:<br> “strictMetadataEmit”: false,<br> “skipTemplateCodegen”: false,</li></ul><p>Refer this page for documentation: <a href="https://angular.io/guide/angular-compiler-options">https://angular.io/guide/angular-compiler-options</a></p><ul><li><a href="http://twitter.com/Effect">@Effect</a> annotation has now deprecated, you should use createEffect function from <a href="http://twitter.com/ngrx/effects">@ngrx/effects</a> library now.<br> <br> Import it from <a href="http://twitter.com/ngrx/effects">@ngrx/effects</a>:</li></ul><pre>import { createEffect, ofType } from ‘<a href="http://twitter.com/ngrx/effects">@ngrx/effects</a>’; </pre><p>Example usage:</p><pre> customerSearchtEffect = createEffect(() =&gt; this.actions<br>   .pipe(<br>     ofType&lt;fromAction.FetchConsumer&gt;(fromAction.FETCH_CONSUMER),<br>     map(action =&gt; action.payload),<br>     switchMap((consumerId: string) =&gt;<br>       this.consumerService.getConsumer(consumerId, CustomerType.CONSUMER).pipe(<br>         map((customer: Customer) =&gt; new fromAction.FetchConsumerSuccess(customer)),<br>         catchError(err =&gt; of(new fromAction.FetchConsumerFail(err)))<br>       )<br>     )<br>   )<br> );</pre><ul><li>When expanding objects with attributes, use spread operator instead of making assignments. Otherwise it might complain about object extensibility.</li></ul><p>False: customer.couponCode = ‘value’;<br>Correct: customer = { …customer, couponCode: ‘value’ };</p><ul><li>TestBed.get deprecated, TestBed.inject should be used now</li><li>If you have an angular library, you should deactivate ivy when compiling it.</li><li>If you use <a href="http://twitter.com/angular/flex-layout">@angular/flex-layout</a> library, you should start using MediaObserver instead of ObservableMedia in the latest versions. Search and replace class name everywhere in the project.</li><li>Angular uses different typescript versions in every release. <br> They wants us to pay attetion to the changes especially in these versions:<br> * Angular 6 — <a href="https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html">https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html</a><br> * Angular 7 — <a href="https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html">https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html</a><br> * Angular 9 — <a href="https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html">https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html</a><br> <a href="https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html">https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html</a><br> * Angular 10 — <a href="https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html">https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html</a><br> * Angular 11 — <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/">https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/</a><br> * Angular 12 — <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-2/">https://devblogs.microsoft.com/typescript/announcing-typescript-4-2/</a></li></ul><p>So that was it for me, you can leave a comment below for your own experiences and troubles you faced with. Good luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99ba8700eb8e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/piateamtech/issues-i-faced-when-upgrading-the-angular-versions-99ba8700eb8e">The Issues I Faced When Upgrading The Angular Versions</a> was originally published in <a href="https://medium.com/piateamtech">Pia-Team Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>