我有一個* ngFor內部的圖像的列表,我需要控制圖像的負載爲:用索引號防止負載ngFor
- 首先負載圖像X
- 當所有其他圖像加載,啓動功能
我的目標是首先顯示最重要的圖像,儘快沒有其他圖像消耗帶寬。
我發現了一些JavaScript解決方案,但它們都使用了不允許使用的文檔和窗口對象,或者由角色團隊推薦使用。
我有一個非常簡單的模型和視圖。它甚至有可能嗎?
var images = ['src1','src2','src3','src4'];
<div *ngFor = "let img of images"> {{img}} </div>
如何確定最重要的圖片是什麼? –
爲什麼你認爲文件和窗口不允許或建議? –
不需要以編程方式確定,我是否錯誤地使用文檔和窗口對象? – Sajad