0
我有兩個JSON輸入,Ember處理多重回報?
輸入1:
var status = [{
isLogged : true
}];
輸入2:
var posts = [{
id: '1',
datalink:124,
isVoted : true,
votecount : 123,
title: "Rails is Omakase",
author: { name: "d2h" },
date: new Date('12-27-2012'),
excerpt: "There are lots of à la carte software environments in this world. Places where in order to eat, you must first carefully look over the menu of options to order exactly what you want."
}]
一切正常的時候有一個JSON,
App.Route = Ember.Route.extend({
model : function(){
return posts;
}
});
但是,當我添加第二個輸入它不起作用
App.Route = Ember.Route.extend({
model : function(){
return posts;
},
logged : function(){
return status;
}
});
如何獲得第二個輸入和顯示在html中?
{{#if isLogged}}
<li><a href="#">Logout</a></li>
{{else}}
<li><a href="#">Login</a></li>
{{/if}}
如果這個回答正確的你的問題不要忘了標記爲好答案! :) – 2014-10-03 01:50:16