Skip to content

Commit

Permalink
Adding trim function check for IE8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecil Worsley committed Apr 8, 2014
1 parent 0711c00 commit 4512612
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/js/timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ angular.module('timer', [])
},
controller: ['$scope', '$element', '$attrs', '$timeout', function ($scope, $element, $attrs, $timeout) {

// Checking for trim function since IE8 doesn't have it
// If not a function, create tirm with RegEx to mimic native trim
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
}
}

//angular 1.2 doesn't support attributes ending in "-start", so we're
//supporting both "autostart" and "auto-start" as a solution for
//backward and forward compatibility.
Expand Down

0 comments on commit 4512612

Please sign in to comment.