我似乎无法追查此错误的来源:
断言失败:没有找到'0'的模型
JSON正在被服务器获取,但是应用程序在发送到模板之前出错了.问题似乎发生在REST适配器和路由器之间.当我使用夹具适配器时,模板呈现无错误.
我正在使用Ember和Handlebars版本1.0.0.
这是我的应用代码:
window.App = Ember.Application.create();
App.ApplicationAdapter = DS.RESTAdapter.extend({
host: 'http://localhost:3000'
});
App.Router.map(function() {
this.resource("stories", { path: "/" }, function() {
this.resource("boards", { path: "/boards"} )
});
});
App.StoriesRoute = Ember.Route.extend({
model: function() {
return this.store.findAll('story');
}
});
attr = DS.attr;
App.Story = DS.Model.extend({
color: attr()
});
Run Code Online (Sandbox Code Playgroud)
把手模板
<script type="text/x-handlebars">
{{ outlet }}
</script>
<script type="text/x-handlebars" data-template-name="stories">
<ul>
<li class="storyLine">
<ul>
<li id="colorSwatch"></li>
<li class="board">+</li>
</ul>
</li>
</ul>
<ul>
{{#each model}}
<li class="storyLine">
<ul>
<li id="colorSwatch" {{bindAttr class=story.color}}></li> …Run Code Online (Sandbox Code Playgroud) 我可以用来传输大文件的最佳协议是什么,应该快速可靠?它必须支持低带宽系统,因为我需要跨印度传输文件.文件大小可以是100到500MB.