Skip to content

Commit

Permalink
chore($sniffer): make msie variable public
Browse files Browse the repository at this point in the history
The msie variable is a global variable used within the ng core which contains the
version number for the current Internet Explorer browser that is rendering the
application. Other modules outside of the ng core could make use of this variable
instead of having to rollout duplicate detection code. This code makes it easy to
reuse this simple property within the $sniffer service.
  • Loading branch information
matsko authored and jamesdaily committed Jan 27, 2014
1 parent 243af51 commit 4c92b7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ng/sniffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ function $SnifferProvider() {
csp: csp(),
vendorPrefix: vendorPrefix,
transitions : transitions,
animations : animations
animations : animations,
msie : msie
};
}];
}
4 changes: 4 additions & 0 deletions test/ng/snifferSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,4 +333,8 @@ describe('$sniffer', function() {
});
});
});

it('should return true for msie when internet explorer is being used', inject(function($sniffer) {
expect($sniffer.msie > 0).toBe(window.navigator.appName == 'Microsoft Internet Explorer');
}));
});

0 comments on commit 4c92b7d

Please sign in to comment.