fix(ngBindHtml): throw error if interpolation is used in expression

Closes #8824
This commit is contained in:
rodyhaddad
2014-08-28 19:25:36 -04:00
parent 5f3f25a1a6
commit cd21602d5b
2 changed files with 12 additions and 4 deletions

View File

@@ -122,6 +122,14 @@ describe('ngBind*', function() {
describe('ngBindHtml', function() {
it('should complain about accidental use of interpolation', inject(function($compile) {
expect(function() {
$compile('<div ng-bind-html="{{myHtml}}"></div>');
}).toThrowMinErr('$parse', 'syntax', "Syntax Error: Token 'myHtml' is unexpected, " +
"expecting [:] at column 3 of the expression [{{myHtml}}] starting at [myHtml}}].");
}));
describe('SCE disabled', function() {
beforeEach(function() {
module(function($sceProvider) { $sceProvider.enabled(false); });