<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Web Comonents Zone Flags Break Angular Router in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-comonents-zone-flags-break-angular-router/m-p/1400835#M84126</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I was trying to setup ArcGIS webcomponents in Angular 17. I followed the template on GitHub and the official documentation.&amp;nbsp;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/components-get-started-angular/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/components-get-started-angular/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta/tree/main/packages/map-components/templates/angular" target="_blank" rel="noopener"&gt;https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta/tree/main/packages/map-components/templates/angular&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It works in the demo and it also kind of works in my real application.&amp;nbsp;&lt;BR /&gt;I realized, that the zoom in and out buttons were not working. The reason was, I did not add zone-flags.ts to the polyfills of my application.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta/blob/main/packages/map-components/templates/angular/src/zone-flags.ts" target="_blank" rel="noopener"&gt;https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta/blob/main/packages/map-components/templates/angular/src/zone-flags.ts&lt;/A&gt;&lt;/P&gt;&lt;P&gt;After adding that, the buttons work. Great. But this cannot be the correct solution to the problem. It completely breaks the Angular Router. Whenever I click on any a tag (link) which has a routerLink directive attached, Angular complains about routing happening outside NgZone.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;a routerLink="/inventory"&amp;gt;Inventory&amp;lt;/a&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;A simple link like this would not work.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="andale mono,times"&gt;Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes the routing would not happen immediately but only after a few seconds.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;When removing the polyfills suggested in the template / tutorial, everything works again.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;How did you guys solve this issue? The map itself works, zooming in and out with the mouse, dragging the map around... The interaction with the buttons does not, if the polyfill is not added.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for your help.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Best reagards&amp;nbsp;&lt;BR /&gt;Alex&lt;/P&gt;</description>
    <pubDate>Tue, 26 Mar 2024 12:29:18 GMT</pubDate>
    <dc:creator>boa_panter</dc:creator>
    <dc:date>2024-03-26T12:29:18Z</dc:date>
    <item>
      <title>Web Comonents Zone Flags Break Angular Router</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-comonents-zone-flags-break-angular-router/m-p/1400835#M84126</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I was trying to setup ArcGIS webcomponents in Angular 17. I followed the template on GitHub and the official documentation.&amp;nbsp;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/components-get-started-angular/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/components-get-started-angular/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta/tree/main/packages/map-components/templates/angular" target="_blank" rel="noopener"&gt;https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta/tree/main/packages/map-components/templates/angular&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It works in the demo and it also kind of works in my real application.&amp;nbsp;&lt;BR /&gt;I realized, that the zoom in and out buttons were not working. The reason was, I did not add zone-flags.ts to the polyfills of my application.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta/blob/main/packages/map-components/templates/angular/src/zone-flags.ts" target="_blank" rel="noopener"&gt;https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta/blob/main/packages/map-components/templates/angular/src/zone-flags.ts&lt;/A&gt;&lt;/P&gt;&lt;P&gt;After adding that, the buttons work. Great. But this cannot be the correct solution to the problem. It completely breaks the Angular Router. Whenever I click on any a tag (link) which has a routerLink directive attached, Angular complains about routing happening outside NgZone.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;a routerLink="/inventory"&amp;gt;Inventory&amp;lt;/a&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;A simple link like this would not work.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="andale mono,times"&gt;Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes the routing would not happen immediately but only after a few seconds.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;When removing the polyfills suggested in the template / tutorial, everything works again.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;How did you guys solve this issue? The map itself works, zooming in and out with the mouse, dragging the map around... The interaction with the buttons does not, if the polyfill is not added.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for your help.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Best reagards&amp;nbsp;&lt;BR /&gt;Alex&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 12:29:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-comonents-zone-flags-break-angular-router/m-p/1400835#M84126</guid>
      <dc:creator>boa_panter</dc:creator>
      <dc:date>2024-03-26T12:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Web Comonents Zone Flags Break Angular Router</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-comonents-zone-flags-break-angular-router/m-p/1400923#M84128</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/779524"&gt;@boa_panter&lt;/a&gt; please see my comments and post additional information in this other thread:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-buttons-don-t-work-in-angular-map-component/m-p/1398115/highlight/true#M84074" target="_blank"&gt;https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-buttons-don-t-work-in-angular-map-component/m-p/1398115/highlight/true#M84074&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 14:52:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-comonents-zone-flags-break-angular-router/m-p/1400923#M84128</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2024-03-26T14:52:15Z</dc:date>
    </item>
  </channel>
</rss>

