我试图在link属性中添加一个类,但类名是有条件的.
{{#link-to "role" this classNames="isLoading:is-loading" tag="tr" }}
<td {{ bind-attr class="isLoading:is-loading"}}>{{ name }}</td>
<td>{{ role }}: {{ isLoading }}</td>
<td>EDIT</td>
{{/link-to}}
Run Code Online (Sandbox Code Playgroud)
就像这样.但不知怎的,它不起作用.
还有另一种方法吗?
给定这样的应用程序路径:
App.ApplicationRoute = Ember.Route.extend({
model: function() {
return new Ember.RSVP.Promise(function(resolve) {
setTimeout(function() {
resolve();
}, 3000);
});
}
});
Run Code Online (Sandbox Code Playgroud)
如何在此模型挂钩等待时显示加载模板?
我试过这样的事情:
<script type="text/x-handlebars" id="loading">
<h3>Loading...</h3>
</script>
Run Code Online (Sandbox Code Playgroud)
但这仅在加载应用程序的子路径时显示.如何在应用程序本身仍在加载时显示加载模板?
谢谢.
这是我的代码:
if(is_array($ItemAttr["Actor"])){
$Actors = implode(", ", $ItemAttr["Actor"]);
} else {
$Actors = $ItemAttr["Actor"];
}
Run Code Online (Sandbox Code Playgroud)
我越来越 undefined index: Actor in **line 1** and **line 3**
我想我应该使用isset()函数.任何人都可以告诉我如何将该函数与is_array()函数结合起来..?