var theApp = angular.module('theApp', []);
var app = angular.module('theApp', ['ui.bootstrap']);
app.controller('MenuSideController', ['$scope','SnazzyService','$modal','$log', function($scope, SnazzyService, $modal, $log) {
$scope.user.zoomlvl = '2';
}]);
I have the above controller and it sets a $scope which I can only ever access the values from inside.
But I seen somewhere that using the below I would be able to access the $scope but when I console.log($scope) the $scope.user.zoomlvl it doesn't exist.
I cannot figure out how to access the MenuSideController $scope and update that with the valZoom variable.
var appElement = document.querySelector('[ng-app=theApp]');
var $scope = angular.element(appElement).scope();
console.log($scope);
$scope.$apply(function() {
$scope.user.zoomlvl = valZoom;
});
$watchonly works whne the input is keyed in but not when the value is updated by$('#zoom').val(valZoom);