0
試圖讓我的頭繞過Ember Data並且無法顯示來自JSON的特定數據。目前在開發過程中使用Fixtures適配器:使用Ember Data從JSON顯示數據
TM.Users = DS.Model.extend({
job_number: DS.attr(),
purl: DS.attr(),
record_type: DS.attr(),
sessions: DS.attr()
});
TM.Users.FIXTURES = [
{
"id": "1",
"job_number": "1234",
"purl": "1234jdoe",
"details": {
"forename": "John",
"surname": "Doe",
},
"sessions": [{
"browser_name": "chrome",
"browser_version": "33.0.1750.112",
"os_name": "macintosh",
"os_version": "os x",
}]
}];
<!-- code from my handlbars file -->
<script type="text/x-handlebars" id="view">
<p>Browser Name</p>
<p>{{sessions.browser_name}}</p>
</script>
我想在會話中顯示記錄,但無法做到這一點。
我在做什麼錯?
快速取勝。感謝您的幫助! – Jetchy 2014-10-31 17:26:52