- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当您尝试向 ObjectController
添加绑定(bind)时,它不起作用。
App.FailController = Em.ObjectController.extend({
content: null,
myBinding: "App.router.myController" // <-- fails
});
Uncaught Error: assertion failed: Cannot delegate set('my', ) to the 'content' property of object proxy <.FailController:ember154>: its 'content' is undefined.
它尝试将其添加到 content
属性中。
jsFiddle:demo
最佳答案
鸣谢:至 caligo-mentis谁answered这个在 github 上。
ObjectProxy
将对 set
的任何调用委托(delegate)给 content
属性,除非 ObjectProxy
上存在同名属性代码 > 实例。简单的解决方案是在声明绑定(bind)之前定义具有所需名称的属性。
App.FailController = Em.ObjectController.extend({
my: null,
myBinding: "App.router.myController" // <-- works
});
jsFiddle:demo
关于ObjectController 上的绑定(bind) - Ember.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12502465/
当您尝试向 ObjectController 添加绑定(bind)时,它不起作用。 App.FailController = Em.ObjectController.extend({ cont
我有一个测验 View ,我想按问题 ord 属性对其进行排序。如果测验的唯一属性是问题,这会很简单,但我有一个如下所示的模型结构: 测验模型 App.Quiz = DS.Model.extend({
我在添加一个数组 Controller 作为另一个数组 Controller 的项目 Controller 时遇到问题。 我得到的错误是: Error while loading route: Typ
我很困惑为什么Route和Controller会影响默认的Model。这是一个例子。 App.ApplicationRoute = Ember.Route.extend({ setupCont
我正在尝试学习一些 Ember.js,虽然我意识到一切都在不断变化,但似乎这段代码来自 Sproutcore 2 指南(链接到 Ember.js github 自述文件)不再工作: App.us
我正在尝试在 Ember 应用程序中设置批量操作复选框(例如“删除所选项目”)。这个想法是,如果选择了任何一个复选框,则显示或隐藏大规模操作下拉列表。我还没有放入下拉列表,因为我不知道如何观察数组中的
我在摆弄 Ember 时遇到了一些让我困惑的事情。 我有一个 ArrayController (Index) 和一个项目 Controller (Post)。对于 Post 项 Controller
我有这条路线: App.BoardEditItemRoute = Ember.Route.extend({ model: function(params) { return t
我正在使用 Ember.js 创建一个单页 map 编辑软件。在我的应用程序中,我使用模型来表示 map 的图层状态并将其与实际的 openlayers 图层关联。 我的工作总结: 在我的入口点ma
我是一名优秀的程序员,十分优秀!