Skip to content

Commit

Permalink
patch(ios9-uiwebview): apply v1.1.0
Browse files Browse the repository at this point in the history
This patch works around iOS9 UIWebView regression that causes infinite
digest errors in Angular. The ngIOS9Patch module is automatically
applied to the ionic module.
  • Loading branch information
adamdbradley committed Sep 12, 2015
1 parent c2822e7 commit c145945
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/angular/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint no-unused-vars:0 */
var IonicModule = angular.module('ionic', ['ngAnimate', 'ngSanitize', 'ui.router']),
var IonicModule = angular.module('ionic', ['ngAnimate', 'ngSanitize', 'ui.router', 'ngIOS9UIWebViewPatch']),
extend = angular.extend,
forEach = angular.forEach,
isDefined = angular.isDefined,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* ================ angular-ios9-uiwebview.patch.js v1.1.0-rc.2 ================
* ================== angular-ios9-uiwebview.patch.js v1.1.0 ==================
*
* This patch works around iOS9 UIWebView regression that causes infinite digest
* errors in Angular.
Expand All @@ -10,6 +10,18 @@
* To apply this patch load/bundle this file with your application and add a
* dependency on the "ngIOS9Patch" module to your main app module.
*
* For example:
*
* ```
* angular.module('myApp', ['ngRoute'])`
* ```
*
* becomes
*
* ```
* angular.module('myApp', ['ngRoute', 'ngIOS9UIWebViewPatch'])
* ```
*
*
* More info:
* - https://openradar.appspot.com/22186109
Expand All @@ -22,7 +34,7 @@
* License: MIT
*/

IonicModule.config(function($provide) {
angular.module('ngIOS9UIWebViewPatch', ['ng']).config(function($provide) {
$provide.decorator('$browser', ['$delegate', '$window', function($delegate, $window) {

if (isIOS9UIWebView($window.navigator.userAgent)) {
Expand All @@ -37,7 +49,7 @@ IonicModule.config(function($provide) {

function applyIOS9Shim(browser) {
var pendingLocationUrl = null;
var originalUrlFn = browser.url;
var originalUrlFn= browser.url;

browser.url = function() {
if (arguments.length) {
Expand Down

0 comments on commit c145945

Please sign in to comment.