I had a very disturbing problem when ng-click updates the expected scope variables, the scope variables change in the DOM (when viewed through the chrome debugger), but the dom elements that were changed do not redraw in the browser, I noticed in several browsers and devices, BUT ONLY WHEN THE SCREEN WIDTH IS BELOW 768. I am using angular version 1.2.6. Has anyone encountered this type of problem?
I simplified the code to try to isolate and confirm what was going on. Here is the code in its simplified version:
First view:
<section class="stream-area"> <div class="group"> <div class="gw-fixed-top-panel"> <div class="group-heading "> <div class="panel-title"> <span class="fleft name" ng-click="usergroup.collapsed=!usergroup.collapsed"> CLICK HERE </span> <a ng-show="usergroup.collapsed" title="Click to edit group" ><i class="fa fa-cog"></i></a> <a ng-hide="usergroup.collapsed" title="Click to edit group" ><i class="fa fa-chevron-up"></i></a> <div> {{usergroup.collapsed}}</div> </div> </div> </div> </div> </section>
The controller does nothing at this moment ...
'use strict'; (function () { var groupController = function($scope) { $scope.usergroup={}; $scope.usergroup.collapsed=true; }; myOverall.myApp.controller('GroupController',['$scope', groupController]); }());
The controller is called via .config: (function () {golfWire.gwWebApp = angular.module ('gwWebApp', ['NgRoute', 'NgAnimate', 'NgResource', 'Ui.bootstrap', 'Firebase', 'LocalStorageModule', 'NgGrid']);
myOverall.myApp .config(['$routeProvider','$locationProvider', function($routeProvider, $locationProvider) { $routeProvider .when('/group/view', { controller: 'GroupController', templateUrl: '/app/views/group.html' }) .otherwise({ redirectTo: '/main' }); }]);
source share