Questions tagged [ngsanitize]

The `ngSanitize` module provides functionality to sanitize HTML.

See $sanitize for usage.

93 questions
0
votes
2 answers

AngularJS Ui-Bootstrap ng-bind-html scope resolution of $modal

I'm attempting to open an AngularJS modal and pass in as a parameter HTML form controls. So far I've managed to learn how to pass in and receive back values so long as they are tied to hard coded controls in the modal. The problem seems to be…
0
votes
0 answers

angular translate with ngSanitize - how to display characters such as "&" or "<"

I use angular-translate and it suggests to use ngSanitize. I just implemented it, but now, characters such as & display as &, and the string Next> now displays as Next> because they are sanitized. My HTML is very simple such…
pierrebo
  • 904
  • 2
  • 10
  • 22
0
votes
1 answer

What, exactly, does ngSanitize protect me from?

I did read every article on the first page of google search. At best, there's something vague like it removes script tags and other harmful content. Is that basically all it does? What is this "other harmful content"? What's the end goal here,…
VSO
  • 11,546
  • 25
  • 99
  • 187
0
votes
1 answer

Displaying raw XML in mdDialog

I'm trying to display some XML as is in an $mdDialog using Angular Material. If I display it using a standard alert, I see the XML as I'd expect, but $mdDialog or Angular is stripping all of the tags from it. Here's the code. Neither of the…
Mike Feltman
  • 5,160
  • 1
  • 17
  • 38
0
votes
1 answer

How to safely preserve html color with angularjs sanitize

After use $sanitize to my ng-html-bind, all style was removed. But using $sce.trustAsHtml cause secure issue. So, is there any way to preserve color after $sanitize? For Example, Original string

Asoul
  • 996
  • 1
  • 10
  • 22
0
votes
2 answers

App breaks when I add ngSanitize as a dependency

When I add ngSanitize in my Angular app the system stops working. Here is how I'm calling it: angular.module('routings', ['ngSanitize']).controller('RoutingsController', ['$scope', '$sce',... function($scope, $sce,... angular-sanitize is already in…
William Kennedy
  • 143
  • 1
  • 18
0
votes
1 answer

ngBindHtml not Rendering Sanitized HTML

I've got a simple angular app, and I'm trying to inject some html into the page using ngBindHtml. However, it's not being injected. Here's my HTML:
And here's my angular…
alloy
  • 756
  • 1
  • 13
  • 23
0
votes
0 answers

AngularJs ,ngSanitize and ngRoute don't work together

I have a question about ngRoute.If when I wrote as follows there is not a problem index.html
app.js var app = angular.module('app', ['ngSanitize']) function…
Mensure
  • 1
  • 1
0
votes
1 answer

ng sanitize don't show svg tag angularjs

I have this code var app = angular.module('myApp', ["ngSanitize"]); app.controller('myController', function($scope) { $scope.html = ['
Your html code
', '
2nd…
EMM
  • 171
  • 2
  • 12
0
votes
3 answers

Render HTML entities string in HTML with Angular

I receive an HTML entities string from an API (like this "<p> Some text <br />") and I would like it to be rendered as HTML. If I use the classical HTML solution with sanitize : .filter('html',function($sce){ return function(input){ …
ChrisV
  • 233
  • 4
  • 15
0
votes
0 answers

ng-sanitize is not returning with html tags

I want to display the description users made in the website with ng-repeat. I use php at backend and before inserting the record i used $credentials['description']=htmlentities($credentials['description'], ENT_QUOTES); So my description is converts…
alaksandarjesus
  • 103
  • 1
  • 9
0
votes
0 answers

Angular bootstrap navbar

I have a problem with generated bootstrap navbar elements. If I create a navbar within html like below its working:
0
votes
1 answer

AngularJS html bind and Chome application CSP

I've been developing AngularJS application and trying to make Chrome extension from it. Application gets feeds from remote server in JSON format and one of values is HTML which is binded by using ngSanitize. Everything is fine until trying to bind…
0
votes
1 answer

Urls with escaped double quotes at the end break ngSanitize

I'm using messages from Twitter in an Angular project. I'm using linky to present urls in tweets as clickable links. My problem is that when a double quote is used immediately after a url in a link, ngSanitize, which parses the urls, causes an…
daveyfaherty
  • 4,585
  • 2
  • 27
  • 42
0
votes
1 answer

$sce.TrustAsUrl not Working

I am trying to create an app using angularjs where the input is taken from the input box and is displayed. It is similar to a chat. So the input can contain urls and I am converting them to links with the help of Autolinker.js which I found in this…
Srinath Mandava
  • 3,384
  • 2
  • 24
  • 37