Questions tagged [ngsanitize]

The `ngSanitize` module provides functionality to sanitize HTML.

See $sanitize for usage.

93 questions
50
votes
5 answers

Angular sanitize / ng-bind-html not working?

I've got a repeater set up and can get data to display as long as there is no html within it. I've included angular-sanitize.js and have tried using ng-bind-html But nothing is displayed within the span, only within the ng-bind-html attribute. So it…
Tim Webster
  • 9,158
  • 8
  • 27
  • 30
14
votes
2 answers

AngularJS using $sce.trustAsHtml with ng-repeat

I'm trying to use $sce.trustAsHtml() with a property of an object in ng-repeat. The result is that the HTML is totally blank. The HTML outputs correctly using ngSanitize though.
ZoM
  • 506
  • 1
  • 6
  • 15
14
votes
3 answers

ng-bind-html doesnt work for Input tags

I am trying to store a HTML inside a scope variable and then use it in template view. When I was reading how to do this in angular, I came across ng-bind-html. In that I've noticed that when I bind html tags with , , etc.. it works. But I…
Neel
  • 9,352
  • 23
  • 87
  • 128
8
votes
1 answer

Why do ng-bind-html and $sanitize produce different results?

I'm trying to sanitize the content of some text areas, I cannot use ng-bind-html because it breaks two way binding (ng-model does not work at the same time) Strangely when I apply ng-bind-html to a model it produces a different result to when I use…
Amicable
  • 3,115
  • 3
  • 49
  • 77
5
votes
1 answer

changingThisBreaksApplicationSecurity angular2

I am trying to load a pdf document in an tag in angular2 Dynamically, and when I am trying to change the URL iths throwing an error saying SafeResourceUrlImplchangingThisBreaksApplicationSecurity: "localhost:8002/pdf.pdf"proto: …
Amarnath R Shenoy
  • 5,121
  • 8
  • 24
  • 32
5
votes
0 answers

Allow Angular $sanitize to keep certain tags

I want to enable the user in my app to use certain white-listed HTML tags (like
& ) but disable other HTML tags like , . I can create a custom directive in order to just do it manually, but I…
Thatkookooguy
  • 6,669
  • 1
  • 29
  • 54
5
votes
0 answers

angular-sanitize: how not to sanitize Nothern languages letters (with umlauts)?

We have found that angular-sanitize "sanitizes" the Nordic alphabet's characters and makes them into HTML entities. So every time you input ä character in INPUT and $sanitize your input, you end up with sanitized string that gets these characters…
onkami
  • 8,791
  • 17
  • 90
  • 176
5
votes
2 answers

$sce:itype Attempted to trust a non-string value in a content requiring a string: Context: resourceUrl

I want to play songs stored in my sails server. Path is http://localhost:4000/images/123.mp3. In front end, i'm using ng-repeat to list that songs from server.
Aravinth
  • 397
  • 1
  • 4
  • 19
4
votes
3 answers

AngularJS ngSanitize says "lowercase is not a function"

My problem: I have to use the ngSanitize module, but when I run the project, I have the following error: Failed to instantiate module ngSanitize due to: lowercase is not a function. I've had organized all my .js files, and organize all file…
João Rocha
  • 91
  • 1
  • 6
3
votes
3 answers

$sce.trustAsHtml filter is not getting applied with ng-bind-html on dynamic data

I'm trying to display the html content which I receive in my div.testData by using ng-bind-html together with filter. I've already included 'ngSanitize' in my app. But somehow, it works only partially. Seem like, filter is not getting applied. It…
Sunny
  • 902
  • 3
  • 18
  • 41
3
votes
1 answer

Equivalent to Angular $sanitize in Scala/Java on the server side

I sanitize a string in Angular like so: var sanitized = $sanitize($scope.someHtml); This works well if the user tries to enter malign HTML/Javascript on the application screen. But if the user presses F12 and sends to the server an HTTP request…
ps0604
  • 1,227
  • 23
  • 133
  • 330
3
votes
2 answers

ngSanitize module inject error

I am trying to use angular-sanitize in angularJS. I require angular-sanitize and inject it in my module. But i get the following errors: Uncaught TypeError: f.module(...).provider(...).info is not a function Uncaught Error:…
user6086008
  • 101
  • 3
  • 14
3
votes
0 answers

Can the `linky` filter be used with text containing html tags?

From the linky docs it seems it should work with ng-bind-html. However, if the text contains html tags, then linky overrides the actual html interpretation to transform URLs into links. This can be seen by for instance writing Pretty text with some…
fusio
  • 3,595
  • 6
  • 33
  • 47
3
votes
1 answer

Supress ngBindHtml error in AngularJS

I have a textarea where users can create their own text and are also allowed to use HTML. The text from the textarea is immidiately displayed in a DIV as they type. The DIV has the ng-bind-html attribute on it. So it tries to parse every single…
Vivendi
  • 20,047
  • 25
  • 121
  • 196
3
votes
1 answer

ngSanitize does not allow allow id attribute

I am using ngBindHtml to display some HTML from an (internal) CMS: The HTML contains a link with an id attribute: "Click here to download the…
Mike Chamberlain
  • 39,692
  • 27
  • 110
  • 158
1
2 3 4 5 6 7