2014-10-30 27 views
-1

ng-include是否創建一個新的子範圍?ng-incude是否創建一個新的子範圍?

<html> 
<body ng-app="mytodoApp"> 
<div class="container" ng-include="'views/main.html'" ng-controller="MainCtrl"></div> 
</html> 
+0

你應該努力一下並閱讀[docs](https://docs.angularjs.org/api/ng/directive/ngInclude)。 – 2014-10-30 15:04:51

回答

5

是的,從https://docs.angularjs.org/api/ng/directive/ngInclude

此指令創建新的範圍。

+0

如何獲取子範圍? – 2014-10-30 14:52:59

+0

@SaiAvinash從哪裏? – sp00m 2014-10-30 14:53:35

+0

@ sp00m ..你可以看看這個嗎? http://stackoverflow.com/questions/26654059/trouble-with-basic-todo-app-angular-js/26654181?noredirect=1#comment41914735_26654181 – 2014-10-30 14:58:31

相關問題