<?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 Angular and Calcite elements in Calcite Design System Questions</title>
    <link>https://community.esri.com/t5/calcite-design-system-questions/angular-and-calcite-elements/m-p/1302004#M427</link>
    <description>&lt;P&gt;I love the simplicity of Angular, where it is possible to seperate the logic from the UI. But at the moment I am struggeling to find a good way to implement some of Calcites elements into my Angular solution. For instance the combobox element.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Simplified example 
export class MyComponent {
   allLayers: string[] = ['a', 'b', 'c', 'd', 'e', 'f']
   selectedLayers: string[] = ['a', 'f']
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!-- Component --&amp;gt;
&amp;lt;calcite-combobox placeholder="Select a field" [value]="selectedLayers"&amp;gt;
  &amp;lt;calcite-combobox-item *ngFor="let item of allLayers" [value]="item" [textLabel]="item"&amp;gt;&amp;lt;/calcite-combobox-item&amp;gt;
&amp;lt;/calcite-combobox&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can populate the items in the component but not the selected layers.&lt;/P&gt;&lt;P&gt;I can respond to the change in selection responding like&amp;nbsp;&lt;EM&gt;[&lt;SPAN&gt;calciteComboboxChange)&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;CalciteComboboxChange&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$event&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;"&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;and update the selectedLayers variable. But I would love to have a possibility to use two-way binding like this [(value)]="selectedLayers".&lt;/P&gt;&lt;P&gt;I know I can use &lt;EM&gt;[selected]="true"&lt;/EM&gt; on the elements, but then it does not keep the order in which the elments were selected.&lt;/P&gt;&lt;P&gt;BTW.: It is also annoying when selecting one element, it sends just the element and more than one an array.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jun 2023 14:18:28 GMT</pubDate>
    <dc:creator>Robert_van_Gilst</dc:creator>
    <dc:date>2023-06-22T14:18:28Z</dc:date>
    <item>
      <title>Angular and Calcite elements</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/angular-and-calcite-elements/m-p/1302004#M427</link>
      <description>&lt;P&gt;I love the simplicity of Angular, where it is possible to seperate the logic from the UI. But at the moment I am struggeling to find a good way to implement some of Calcites elements into my Angular solution. For instance the combobox element.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Simplified example 
export class MyComponent {
   allLayers: string[] = ['a', 'b', 'c', 'd', 'e', 'f']
   selectedLayers: string[] = ['a', 'f']
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!-- Component --&amp;gt;
&amp;lt;calcite-combobox placeholder="Select a field" [value]="selectedLayers"&amp;gt;
  &amp;lt;calcite-combobox-item *ngFor="let item of allLayers" [value]="item" [textLabel]="item"&amp;gt;&amp;lt;/calcite-combobox-item&amp;gt;
&amp;lt;/calcite-combobox&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can populate the items in the component but not the selected layers.&lt;/P&gt;&lt;P&gt;I can respond to the change in selection responding like&amp;nbsp;&lt;EM&gt;[&lt;SPAN&gt;calciteComboboxChange)&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;CalciteComboboxChange&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$event&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;"&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;and update the selectedLayers variable. But I would love to have a possibility to use two-way binding like this [(value)]="selectedLayers".&lt;/P&gt;&lt;P&gt;I know I can use &lt;EM&gt;[selected]="true"&lt;/EM&gt; on the elements, but then it does not keep the order in which the elments were selected.&lt;/P&gt;&lt;P&gt;BTW.: It is also annoying when selecting one element, it sends just the element and more than one an array.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 14:18:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/angular-and-calcite-elements/m-p/1302004#M427</guid>
      <dc:creator>Robert_van_Gilst</dc:creator>
      <dc:date>2023-06-22T14:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Angular and Calcite elements</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/angular-and-calcite-elements/m-p/1302296#M428</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/424647"&gt;@Robert_van_Gilst&lt;/a&gt;&amp;nbsp;This is inherit to web components, where the Combobox attributes don't automatically get mapped until the element is defined.&lt;/P&gt;&lt;P&gt;To set the elements you can either check the attribute, or &lt;A href="https://developers.arcgis.com/calcite-design-system/core-concepts/#loading-components" target="_blank" rel="noopener"&gt;wait for the element to be defined and the component is loaded&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;For instance:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;A href="https://codepen.io/geospatialem/pen/mdQrZKX" target="_blank" rel="noopener"&gt;Codepen sample&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://codesandbox.io/s/angular-and-cc-customelements-whendefined-9myz8h?file=/src/app/app.component.ts" target="_blank" rel="noopener"&gt;Codesandbox sample with @angular and @ionic/pwa-elements&lt;/A&gt;:&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;The &lt;A href="https://www.npmjs.com/package/@ionic/pwa-elements" target="_blank" rel="noopener"&gt;@ionic/pwa-elements&amp;nbsp;module&lt;/A&gt; was added, and two lines were added to the &lt;A href="https://codesandbox.io/s/angular-and-cc-customelements-whendefined-9myz8h?file=/src/main.ts" target="_blank" rel="noopener"&gt;main.ts file&lt;/A&gt;&amp;nbsp;(lines 8 and 24)&lt;UL&gt;&lt;LI&gt;Alternatively a utility could be saved to the codebase which includes &lt;A href="https://github.com/ionic-team/ionic-framework/blob/main/core/src/utils/helpers.ts#L72-L79" target="_blank" rel="noopener"&gt;the componentOnReady Ionic helper&lt;/A&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;The &lt;A href="https://angular.io/api/core/AfterViewInit" target="_blank" rel="noopener"&gt;AfterViewInit lifecycle hook&lt;/A&gt; is used to wait for the element to be defined.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Thu, 22 Jun 2023 23:49:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/angular-and-calcite-elements/m-p/1302296#M428</guid>
      <dc:creator>KittyHurley</dc:creator>
      <dc:date>2023-06-22T23:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Angular and Calcite elements</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/angular-and-calcite-elements/m-p/1302377#M429</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/574219"&gt;@KittyHurley&lt;/a&gt;&amp;nbsp;this helped.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But unfortunately it breaks the angular way of working of separating the UI and code complete. I rather have no references to components in my code. So I probably have create some wrapper components in my solution, to get me past this &lt;SPAN&gt;inconvenience.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Or is your team also working on a Angular Components implementation&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 08:45:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/angular-and-calcite-elements/m-p/1302377#M429</guid>
      <dc:creator>Robert_van_Gilst</dc:creator>
      <dc:date>2023-06-23T08:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Angular and Calcite elements</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/angular-and-calcite-elements/m-p/1302609#M430</link>
      <description>&lt;P&gt;Good to hear the above resources were helpful!&lt;/P&gt;&lt;P&gt;Calcite is working towards an Angular wrapper in the near future, so there will be additional support coming soon.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 19:02:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/angular-and-calcite-elements/m-p/1302609#M430</guid>
      <dc:creator>KittyHurley</dc:creator>
      <dc:date>2023-06-23T19:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Angular and Calcite elements</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/angular-and-calcite-elements/m-p/1305012#M440</link>
      <description>&lt;P&gt;When will&amp;nbsp;&lt;SPAN&gt;Angular wrapper be ready to use? I'm working on a project using Angular with Calcite components right now.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2023 19:03:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/angular-and-calcite-elements/m-p/1305012#M440</guid>
      <dc:creator>ForrestLin</dc:creator>
      <dc:date>2023-06-30T19:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Angular and Calcite elements</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/angular-and-calcite-elements/m-p/1306036#M445</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/574219"&gt;@KittyHurley&lt;/a&gt;&amp;nbsp;that sounds great with an Angular wrapper. What means "in the near future"? I hope weeks, but that is probably wishful thinking&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 06:45:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/angular-and-calcite-elements/m-p/1306036#M445</guid>
      <dc:creator>Robert_van_Gilst</dc:creator>
      <dc:date>2023-07-06T06:45:19Z</dc:date>
    </item>
  </channel>
</rss>

