Select to view content in your preferred language

How to create a custom widget using ViewModel in Angular

474
2
Jump to solution
10-07-2024 07:23 AM
ForrestLin
Frequent Contributor

Please provide a example on how to create a custom widget using ViewModel in Angular. 

For example: create a custom CoordinateConversion Widget using CoordinateConversionViewModel in Angular.

 

Thanks.

Forrest

0 Kudos
1 Solution

Accepted Solutions
AndyGup
Esri Regular Contributor

Hi @ForrestLin, we deprecated the pattern of extending the viewModel for widgets. We now recommend using the JS framework's component capabilities. We don't have an Angular example, but here a React example: https://github.com/Esri/jsapi-resources/tree/main/core-samples/jsapi-custom-ui

Reference: https://developers.arcgis.com/javascript/latest/custom-ui/#custom-framework-components

View solution in original post

0 Kudos
2 Replies
AndyGup
Esri Regular Contributor

Hi @ForrestLin, we deprecated the pattern of extending the viewModel for widgets. We now recommend using the JS framework's component capabilities. We don't have an Angular example, but here a React example: https://github.com/Esri/jsapi-resources/tree/main/core-samples/jsapi-custom-ui

Reference: https://developers.arcgis.com/javascript/latest/custom-ui/#custom-framework-components

0 Kudos
ForrestLin
Frequent Contributor

@AndyGup 

Got it.

It's much convenient to create the UI Widget using Angular Component and useing viewModels as business logic.

By the way, is it possible to do two-way binding in calcite-component-angular?

 

Thanks.

Forrest

0 Kudos