Here are the snippets of code I am working with:
The state (abbreviated for simplicity)
.state('foo', {
url: '/foo',
templateUrl: 'path/to/template.html',
controller:'fooCtrl',
})
The controller
controller = function($scope){
// not the actual code
$scope.barCount
}
template.html
<div>
<span>{{ barCount }}</span> // this is updating properly
</div>
Other html partial
<div ng-controller="fooCtrl">
<span>{{ barCount }}</span> // this is **NOT** updating properly
</div>
I have a scope
variable in my controller. The 2-way binding works fine in the template linked to the state
along with the controller, but not in the other template where I use ng-controller
to bind it.
Could this be a bug? Or am I overlooking something here? Thank you.