【问题标题】:Render Data from Fixtures in Ember在 Ember 中渲染来自 Fixtures 的数据
【发布时间】:2015-03-14 07:14:40
【问题描述】:

我正在尝试构建简单的 ember 应用程序。我使用缓存 FIXTURES 来渲染模板中的数据。但是,我没有在这个模板中做错了什么。

Here is the example jsbin

模板代码:

{{#each}}
      <option>{{mname}}</option>
{{/each}}

js代码:

 timeZoneApp.CalendarboxRoute = Ember.Route.extend({
   model: function() {
       return this.store.findAll('calendarbox');
   }
});

【问题讨论】:

    标签: javascript ember.js ember-data


    【解决方案1】:

    你忘了实际定义路线:

    timeZoneApp.Router.map(function() {
      this.resource('calendarbox', {path: '/'});
    });
    

    http://jsbin.com/tewelusewe/1/edit?html,js,output

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-29
      • 2021-03-20
      • 1970-01-01
      • 1970-01-01
      • 2020-09-05
      • 2019-10-07
      • 1970-01-01
      • 2019-04-26
      相关资源
      最近更新 更多