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
  •  | 
  •  

Вопрос

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?

Это было полезно?

Решение

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top