Filter | Source | Rendered |
html filter |
<div ng-bind-html="snippet"> |
|
no filter | <div ng-bind="snippet"> |
|
unsafe html filter | <div ng-bind-html-unsafe="snippet"> |
an html\nclick here\nsnippet
'); }); it('should escape snippet without any filter', function() { expect(using('#escaped-html').element('div').html()). toBe("<p style=\"color:blue\">an html\n" + "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" + "snippet</p>"); }); it('should inline raw snippet if filtered as unsafe', function() { expect(using('#html-unsafe-filter').element("div").html()). toBe("an html\n" + "click here\n" + "snippet
"); }); it('should update', function() { input('snippet').enter('new text'); expect(using('#html-filter').binding('snippet')).toBe('new text'); expect(using('#escaped-html').element('div').html()).toBe("new <b>text</b>"); expect(using('#html-unsafe-filter').binding("snippet")).toBe('new text'); });Filter | Source | Rendered |
linky filter |
<div ng-bind-html="snippet | linky"> |
|
linky target |
<div ng-bind-html="snippetWithTarget | linky:'_blank'"> |
|
no filter | <div ng-bind="snippet"> |