I have the following code (see below). When I click on the button and select the file, data.myVar in the view remains unchanged. (Somehow I do see that $scope.data.myVar
updates correctly while stepping through the controller). Why is this happening?
html excerpt (it is under under the controller below):
{{data.myVar}}
<input type="file" onchange="angular.element(this).scope().setRuleFile(this)" />
JS:
angular.module('myModule')
.controller('MyCtrl', ['$scope', function ($scope) {
$scope.data = {
myVar: 'init'
};
$scope.setRuleFile = function(element) {
$scope.data.myVar = 'changed';
}
}]);