Angularjs 异步背景图像:url(…)和ng repeat
假设我有一个API,它获取一个博客文章列表,每个文章都有自己的背景图像链接Angularjs 异步背景图像:url(…)和ng repeat,angularjs,asynchronous,angularjs-ng-repeat,Angularjs,Asynchronous,Angularjs Ng Repeat,假设我有一个API,它获取一个博客文章列表,每个文章都有自己的背景图像链接 <article ng-style="{'background-image': 'url({{ post.meta.cover }})'}" ng-repeat="post in blog.listOfPost"> 问题:在从api加载所有数据之前,我如何延迟解析html?如果您正在等待url,您只需检查它: <article ng-style="post.meta.cover ? {'backgro
<article ng-style="{'background-image': 'url({{ post.meta.cover }})'}" ng-repeat="post in blog.listOfPost">
问题:在从api加载所有数据之前,我如何延迟解析html?如果您正在等待url,您只需检查它:
<article ng-style="post.meta.cover ? {'background-image': 'url(' + post.meta.cover + ')'} : {}" ng-repeat="post in blog.listOfPost">
<article ng-style="post.meta.cover ? {'background-image': 'url(' + post.meta.cover + ')'} : {}" ng-repeat="post in blog.listOfPost">