0

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')
                    }
        };

1 Answer 1

1

Have you tried using anonymous/incognito mode both in firefox/chrome.

According to this the cache is never used in that mode: https://www.quora.com/Does-incognito-mode-on-Chrome-use-the-cache-that-was-previously-stored

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.