/
githubmirror
/
angular.js
Обзор
Документация
Войти
/
githubmirror
/
angular.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/ngSanitize/directive/ngBindHtmlSpec.js
28 строк
868 B
Martin Staffa
fix(Angular): remove `angular.lowercase` and `angular.uppercase`
08 мар 2017, 16:33
08 мар 2017, 16:33
1daa4f2
Код
Авторство
О чём код?
'use strict'; describe('ngBindHtml', function() { beforeEach(module('ngSanitize')); it('should set html', inject(function($rootScope, $compile) { var element = $compile('<div ng-bind-html="html"></div>')($rootScope); $rootScope.html = '<div unknown>hello</div>'; $rootScope.$digest(); expect(lowercase(element.html())).toEqual('<div>hello</div>'); })); it('should reset html when value is null or undefined', inject(function($compile, $rootScope) { var element = $compile('<div ng-bind-html="html"></div>')($rootScope); angular.forEach([null, undefined, ''], function(val) { $rootScope.html = 'some val'; $rootScope.$digest(); expect(lowercase(element.html())).toEqual('some val'); $rootScope.html = val; $rootScope.$digest(); expect(lowercase(element.html())).toEqual(''); }); })); });