I'm trying to modify a variable inside $scope within a controller's function and the affectation works, but didn't apply in the view.
app.controller('LoginCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.test = "test";
$scope.logIn = function() {
// This changes the value to test2, but does not applies it to the view.
$scope.test = "test2";
};
}]);
In the login.html:
DEBUG: {{ test }}
And the routeProvider:
$routeProvider
.when('/', {
templateUrl: '/views/login.html',
controller: 'LoginCtrl'
})
Is something I miss out the documentation ?
Thanks !
ng-controllerorng-appcorrectly.logInfunction is actually getting called to change value on the scope.