I have two function in controller that are connected to two checkboxes in view. The problem is that every time I do any change in these functions it is not detected by the browser. I even went and removed both of the functions completely and the browser behaved as if they were still there. This is happening in all firefox and chrome
I did some research online and seems to me that this is problem of angular caching templates. I do use ui-router but so far
I have removed my browser cache it did'nt solve the problem
I added this code but nothing seems to help
app.run(function($rootScope, $templateCache) {
$rootScope.$on('$routeChangeStart', function(event, next, current) {
if (typeof(current) !== 'undefined'){
$templateCache.remove(current.templateUrl);
}
});
My code:
<div class="checkbox">
<label class='checkboxes' id='checkbox_1'>
<input type="checkbox" ng-model="thirtyDay" ng-change="changeAxis1()">
Last 30 days
</label>
<label class='checkboxes' id='checkbox_2'>
<input type="checkbox" ng-model="wholeTimeline" ng-change="changeAxis2()">
Election timeline
</label>
</div>
Controller:
$scope.wholeTimeline = true;
$scope.changeAxis2 = function() {
if($scope.wholeTimeline) {
$scope.thirtyDay = false;
alert('is checked')
} else {
alert('is unchecked')
}
};
$scope.changeAxis1 = function() {
if ($scope.thirtyDay) {
$scope.wholeTimeline = false;
alert('is checked')
}else {
alert('is unchecked')
}
};