0

试图模仿这个小提琴http://jsfiddle.net/W2C45/6/

但是当我打电话时

$route.parent(this);

我收到错误

TypeError: Object # has no method 'parent'

我认为这是因为小提琴使用的是 0.9.. 而我使用的是 1.3.0。

0.9 doco 以这种方式描述了 $route 的父方法......

     * Sets a scope to be used as the parent scope for scopes created on route change. If not
     * set, defaults to the root scope.

完成这项工作的“1.3”方式是什么?

4

1 回答 1

0

实际上范围是“原型”继承的。这意味着所有作用域都会自动继承它们所在作用域的所有属性。

那么你能描述一下你想要得到什么功能吗?

这是Plnkr 的来源,您的 Fiddle 在 1.0.3 中重写

于 2013-01-09T12:38:51.403 回答