My index.html looks like this:
<div id="div1" ng-controller="StartMenu">
<div id="button1" ng-click="doSomething()"></div>
{{value}}
</div>
<div id="div2" ng-view></div>
Module configuration:
angular.module('app').config([$routeProvider, function($routeProvider) {
$routeProvider.when('/start', {
templateUrl: 'partials/start.html', controller: StartMenu
});
}]);
start.html:
<div id="button2" ng-click="doSomething()"></div>
{{value}}
And controller function:
function StartMenu($scope, globals) { // service globals defined elsewhere
$scope.value = globals.value
$scope.doSomething = function() {
// Manipulate globals.value
$scope.value = globals.value;
}
}
The problem: These two div elements in index.html share a same controller function. When I click #button1 in #div1 doSomething is invoked and $scope.value is changed. The change is immediately rendered in #div1 and {{value}} changes but #div2 remains unchanged. How do I "force" #div2 to be rendered and to show the change in {{value}}?