How can I not have the initial HTML template rendered when using a PhoneJS dx-gallery widget and a template?

StackOverflow https://stackoverflow.com/questions/23305438

  •  09-07-2023
  •  | 
  •  

Question

I am experimenting with the AngularJS approach for PhoneJS. So far I am really enjoying both frameworks.

Current issues:

  • Using a dx-gallery or dx-list with a datasource and a template will cause the initial un-bound template to be rendered when the view is navigated.

I found this out once I started using the dx-gallery widget and specifying a template. The console will show a network request for the initial template (not bound) being requested.

Code

<div dx-gallery="{ dataSource: imagesDataSource, height:'60%' }">
<div data-options="dxTemplate: { name: 'item' }">
    <img src="http://somehostingcompany.com/{{public_id}}.jpg">
</div>

Question: How can I not have the initial HTML template rendered when using a PhoneJS dx-gallery widget and a template?

Was it helpful?

Solution

Use ns-src binding instead of specifing src directly:

<img ng-src="http://somehostingcompany.com/{{public_id}}.jpg" />

Check out link https://docs.angularjs.org/api/ng/directive/ngSrc

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top