1
我得到一個Error: parent is null [email protected]:3448:7
錯誤從角度的forEach迭代器。我相信這是來自一個嵌套的重複。錯誤:父母爲空 - angular.js
tbody(ng-repeat='comment in comments' ng-include="'../../components/comment.html'")
include ../../components/comment.jade
tr.athing(ng-if="comment.kids" ng-include="'../../components/comment.html'", ng-repeat='comment in comment.kids')
include ../../components/comment.jade
我正在嘗試遍歷一個嵌套的註釋結構。
提供角度看到的呈現的html結構。請注意'ng-include'創建一個子範圍。不知道這是否有意義把它放在'
ng重複不應該在'
'這不是重複。我正在製作一個hackernews克隆,以便我的html符合他們的要求。 –在編輯和發佈新問題之間進行辯論。 –
回答
你應該使用
ngInclude
或玉包括,但不是兩個。此外,您無法在使用ngInclude
的元素上使用子DOM。來源
2015-10-19 17:12:14
我的第一反應是從您的代碼中刪除
ng-include
,因爲您似乎在您的模板中將它內聯?我可能是錯的,但這將是我的第一反應。ng-include
使用transclusion,並可能產生一些意想不到的行爲。來源
2015-10-19 17:17:44
相關問題