aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormetaweta2013-01-29 11:34:14 -0800
committerIgor Minar2013-01-29 15:35:03 -0800
commitd987a79ab198bff150bf47b41d98e5dea5b06a4b (patch)
tree3434b25f2eaf87092c9d19e9809145430186b1c7
parenteba09353e60d7ba2ec0e02fc190a14a662285fe9 (diff)
downloadangular.js-d987a79ab198bff150bf47b41d98e5dea5b06a4b.tar.bz2
test(ngBindHtml): prevent variable name leak
Add "var" so element is local instead of global Strict mode doesn't allow undeclared global vars, and these really should be local anyway.
-rw-r--r--test/ngSanitize/directive/ngBindHtmlSpec.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/ngSanitize/directive/ngBindHtmlSpec.js b/test/ngSanitize/directive/ngBindHtmlSpec.js
index be23e5a5..6759c6d2 100644
--- a/test/ngSanitize/directive/ngBindHtmlSpec.js
+++ b/test/ngSanitize/directive/ngBindHtmlSpec.js
@@ -1,8 +1,11 @@
+'use strict';
+
+
describe('ngBindHtml', function() {
beforeEach(module('ngSanitize'));
it('should set html', inject(function($rootScope, $compile) {
- element = $compile('<div ng-bind-html="html"></div>')($rootScope);
+ var element = $compile('<div ng-bind-html="html"></div>')($rootScope);
$rootScope.html = '<div unknown>hello</div>';
$rootScope.$digest();
expect(angular.lowercase(element.html())).toEqual('<div>hello</div>');
@@ -10,7 +13,7 @@ describe('ngBindHtml', function() {
it('should reset html when value is null or undefined', inject(function($compile, $rootScope) {
- element = $compile('<div ng-bind-html="html"></div>')($rootScope);
+ var element = $compile('<div ng-bind-html="html"></div>')($rootScope);
angular.forEach([null, undefined, ''], function(val) {
$rootScope.html = 'some val';