ng-include 内の html からコントローラ ExampleCtrl の $scope.myProperty の値を設定できないのはなぜですか。しかし、$scope.myObj.myProperty を定義し、html で参照すると、正常に動作するようになりng-model="myObj.myProp"
ますか?
例:
<div ng-app="MyApp">
<div ng-controller='ExampleCtrl'>
<div ng-include="'#inlcude'"></div>
<!-- THIS DON'T WORK -->
<p><b>myProperty:</b>{{myProperty}}</p>
<!-- THIS WORK -->
<p><b>myObj.myProperty:</b>{{myObj.myProperty}}</p>
</div>
</div>
<!-- INCLUDE HTML -->
<div id='include'>
<input ng-model='myProperty' type='text' />
<input ng-model='myObj.myProperty' type='text' />
</div>
ng-include が新しいスコープを作成することは理解していますが、インクルードの html から親スコープの単純なプロパティが表示されないのはなぜですか?
ありがとう