>>I don't know if this is the case or not, but I've gotten in the habit of adding an object into my scope and then adding the properties to it instead. Angular gets weird with scope inheritance and stuff can sometimes just not work.
>>
>>Ex.
>>
>>In the controller:
>>
>>$scope.data = { showFinalized : false };
>>
>>Then ng-bind to "data.showFinalized".
>>
>>(there isn't anything special about the name "data" - you could name this var anything you'd like).
>
>Thanks, Paul. Switching to use an object's property instead of direct $scope property solved this problem.
Quick and dirty way of achieving this: in the controller constructor : $scope.vm = this;
Then in the HTML use the vm prefix to reference the property.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement