Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

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 committed Nov 6, 2013
1 parent 952fea6 commit 974b6d4
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 974b6d4

Please sign in to comment.