Our Angular.js web application sometimes freezes on iOS8 Safari. When this problem occurs, the ng-click callback does not start. If you replace ng-click with regular javascript onclick, this will work. This does not happen in Chrome on iOS8 devices.
Has anyone else noticed this problem in Safari iOS8 or fixed it?
This simple look sometimes freezes on iOS8 safari . Freezing usually occurs when you open a tab, switch to other tabs in the browser, or perhaps leave the browser and return later. In this example, when the view freezes when clicking on links, tapCount does not increase. The more complex the view, the easier it is to freeze. In this example, the browser will freeze for a few seconds when I quickly touch the links. Usually freezing takes longer on real complex performances.
var app = angular.module('myApp', []); app.controller('freezeCtrl', function($scope) { $scope['tapCount'] = 0; $scope['dummyItems'] = []; for(var i = 0; i < 15; i++) { var anItem = {'id': i}; ($scope['dummyItems']).push(anItem); } $scope['updateTapCount'] = function() { $scope.tapCount += 1; }; });
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"></script> <div ng-app="myApp"> <div ng-controller="freezeCtrl"> <p>Tap Count = {{tapCount}}</p> <ul> <li ng-repeat="item in dummyItems" bindonce> <p>This is a dummy item #{{item.id}}</p> </li> </ul> <div> <button ng-click="updateTapCount()">Button 1</button> <button ng-click="updateTapCount()">Button 2</button> </div> </div> </div>
source share