2013-01-09 50 views
0

試圖仿效這個小提琴http://jsfiddle.net/W2C45/6/

但是當我打電話

$route.parent(this); 

我得到錯誤

類型錯誤:對象#有沒有方法 '父'

我認爲這是因爲小提琴使用0.9 ..我使用1.3.0。

0.9 DOCO描述$路線這樣的父類的方法...

 * 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」的方式做了什麼?

+0

好了重寫,我是一個蠢蛋應該已經看過更改日誌.. https://github.com/angular/angular.js/blob/master /CHANGELOG.md#route-service-changes –

回答

0

實際上範圍是繼承的'prototypicaly'。這意味着所有範圍都會自動繼承它們所在範圍的所有屬性。

那麼你能描述一下你想得到的功能嗎?

這是sources at Plnkr與小提琴在1.0.3