When attempting to update the $scope
object from the controller, I am encountering an issue where it is not updating on the DOM. However, in the console, I am able to see the updated status.
Below is my code snippet:
var galleryMenu = ['$route', function ($route) {
return {
scope : true,
replace : true,
template : function () {
var page = $route.current.className || 'home';
return galleryMenuItem(page);
},
controller : function ($scope, $element) {
$scope.galleryProject = function () {
$scope.galleryShow = !$scope.galleryShow;
console.log($scope.galleryShow) //returns true in the console, but the `DOM` does not reflect this change.
}
}
}
}];