I'm trying to change some of the variables inside my angular modules from the console and keep hitting roadblocks.
I have a particular property that will eventually be provided by the backend server. Until that part is ready, I would like to test my templates by changing the property from the console.
So if I borrow an example from the angularjs doc:
myApp.value('clientId', 'a12345654321x');
myApp.controller('DemoController', ['$scope', 'clientId', function DemoController($scope, clientId) {
$scope.clientId = clientId;
}]);
I would like to change the value at runtime from the console. Does anyone know of a way how?
I tried using a different global object but the digest is not picking up changes
var myNamespace = {clientId: "a12345654321x"};
myApp.controller('DemoController', ['$scope', function DemoController($scope) {
$scope.specialGlobal = myNamespace;
}]);
//then in html template
<h1>{{specialGlobal.clientId}}</h1>
This works on initial load, but changes to myNamespace.clientId
through the console are not propagated.
Runnuning angularjs 1.3.x