I have the following codes:
State (allows you to just make it short for simplicity)
.state('foo', {
url: '/foo',
templateUrl: 'path/to/template.html',
controller:'fooCtrl',
})
Controller
controller = function($scope){
$scope.barCount
}
template.html
<div>
<span>{{ barCount }}</span> // this is updating properly
</div>
Other html parts
<div ng-controller="fooCtrl">
<span>{{ barCount }}</span> // this is **NOT** updating properly
</div>
I have a variable scopeon my controller. Two-way binding works fine on a template that was declared statewith the controller. But not on another partial template where I bound the controllerwith the help of ng-controller.
It's some kind of mistake? Or am I missing something? Thanks.
source
share