Questions tagged [ng-bind-html]
ngBindHtml creates a binding that will innerHTML the result of evaluating the expression into the current element in a secure way.
243
questions
0
votes
1
answer
246
views
How to sanitze the row data in the slick-grid?
We are using slick-grid to show the data in our application in angularJS, We have data coming from the backend may contain <,> which is sending it as '<>'. this needs to be ...
1
vote
2
answers
228
views
how passing ng-bind values in to a variable at asp.net core view?
I have a tag like this :
<a data-ng-click="showform(@item.CategoryId)">
I have a variable "catid" in razor...
@{int catid; }
I want save value in 'catid'
this my js code :
...
1
vote
2
answers
932
views
Values are duplicated into all input field which is created using the ng-repeat and ng-model
I am using the ng-repeat to create the input fields dynamically, everything seems to be working fine and the input fields are created but due to some reason when I enter some value into that created ...
1
vote
0
answers
122
views
ng-bind-html with html + angularjs inside
In one of the pages of my app, I am using ng-bind-html to show some text through a function:
<ng-bind-html
ng-bind-html="getText(textContainer)">
</ng-bind-html>
getText() returns some ...
1
vote
1
answer
305
views
Is there a way to configure ng-bind-html that it renders a string like '</'?
it seems ng-bind-html is rendering '</' like a close tag, so it has been sanitized, and the string has pass through, but it renders as close tag in html, which means nothing shows. for example, 'I ...
2
votes
1
answer
188
views
Call a js function on an html snippet rendered using ngBindHtml
I'm fetching some html content that I want to display in an Angular widget. I'm using ng-bind-html to display this html content in the controller. Once this html content has rendered I want to call a ...
0
votes
3
answers
450
views
How to allow external link in angularjs when using ng-bind-html
Here is the rendered code
<div>dfdbfbdfbdfbdfbdfbfb gdfgfggtbrtb
<a href="www.github.com" target="_blank"> rtrtrt
</a>
<p></p>
</div>
I get this, when ...
0
votes
0
answers
185
views
angularjs: event after interpolation/binding happened
Let's say I have an angularjs directive with a template like this:
<span>{{ myLabel }}</span>
Is there an event/service I could tap into to get the resulting interpolated html e.g:
<...
0
votes
2
answers
74
views
How to make a table sort-able while the whole components is passed as string via ng-bind-html in AngluarJS
Hi I have a situation in AngluarJS that the HTML is generated by back-end and the only thing that front-end should do is to put the HTML which is mostly table tags into the ng-bind-html and show it to ...
0
votes
0
answers
470
views
Angular ng-bind-html with SVG not rendering in Internet Explorer
I have an AngularJS directive that needs to render SVG via ng-bind-html.
The ng-bind-html contents are included as expected in Chrome, MS Edge and Firefox, but they're not included in Internet ...
0
votes
0
answers
238
views
Binding complex rich text element in AngularJS
I'm trying to bind a complex, multiline rich text element with AngularJS, say something like:
<h1>Title</h1>
<p>Some content</p>
<p>More Content maybe with <i>...
0
votes
1
answer
92
views
Using ng-bind-html is hiding words enclosed in "<>"
I'm trying to create a textbox that takes free text, and shows the text as output. For instance, if I enter "Angular", the result should be Angular. It should appear as is regardless of the characters ...
0
votes
2
answers
424
views
ng-bind-html with angular-translate renders text instead of HTML tag
I'm back on an old AngularJS project (1.7.2) with angular-translate and I'm struggling with ng-bind-html.
In my HTML I wrote this
<span ng-bind-html="'LEFT_PANEL.VISITED_AFTER' | translate">&...
0
votes
1
answer
85
views
Can't bind <img> tag in HTML content. Angular.js
Hello I am trying to bind an HTML string into my div it contains tags too. Bold strings normal strings showing without any problem but my tags coming as string.
I am using ng-bind-html with ...
0
votes
2
answers
266
views
decoding the html tag from response and showing it in view
My below given response comes as encoded format , i am decoding it using a filter and displaying value in my html . But I need to display them as html in my view. So trustAsHtml has been used. but the ...
1
vote
1
answer
264
views
How to display HTML from response as HTML in ng-repeat
I have n number of records coming from backend as HTML in array. I need to display the HTML response as HTML in my view. I tried ng-bind-html , but it takes the last value. Need assistance.
$scope....
0
votes
1
answer
1k
views
Form data passing as null except for the data updated inputs in angular 4
I have form which has 2 fields and I assigned default value to those inputs when the page loads, When I Submit the form by changing one input field, the updated input has the value in request while ...
0
votes
1
answer
250
views
How do you prevent ng-bind-html from adding closing tags?
I have two pieces of HTML I need to output the first is an opening tag of a div that represents my header, the second is the closing tag of the div that will represent the footer. Between the two I ...
0
votes
0
answers
56
views
Angular 4 - link values from api to component and template
In Angular 4 application, I have table with rows. I have to integrate each row with list-view component, so it shows up correctly in webpage. list view component shows status as success - color green, ...
0
votes
1
answer
1k
views
angular 2 set form value and render html component inside reactive form
So I have a <textarea> inside a form:
html
<form novalidate [formGroup]="formGroup" (ngSubmit)="onSubmit()">
<textarea formControlName="content" [rows]="5"><textarea>...
2
votes
2
answers
978
views
How to render the contents of angular variables inside ng-bind-html
I'm taking a HTML content to the front end javascript code, from the database which was saved as varchar. It is stored in a variable called vm.htmlContent And then I want to display this string type ...
0
votes
1
answer
489
views
Watch ng-model in ng-bind-html using AngularJs
Here is my Markup
<div ng-app="myApp" ng-controller="myCtrl">
<input type="text" ng-model="name">
<p ng-bind-html="myText|unsafe"></p>
</div>
I am using this ...
1
vote
3
answers
104
views
Variable is not showing in binded HTML using AngularJs
<div ng-app="myApp" ng-controller="myCtrl">
<p ng-bind-html="myMarkup"></p>
</div>
<script>
var app = angular.module("myApp", ['ngSanitize']);
app.controller("...
3
votes
3
answers
969
views
$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 ...
0
votes
0
answers
223
views
AngularJS ng-bind-html not working
I have a jade fragment that is built though ng-repeat.
fieldset(data-ng-repeat='product in products track by $index')
input(type='text', ng-model='product.name', name='product.name', ...
3
votes
1
answer
849
views
Show icon on ng-bind-html when value is false
I need to show a fontawesome icon within the ng-bind-html on the ui-select, based on a boolean value
<span ng-bind-html="project.IsActive == false && <i class="fa fa-ban" aria-hidden="...
0
votes
1
answer
431
views
How to use ng-bind-html but disable tag <h1>, <b>... AngularJS
I used ng-bind-html and show success data, but I want to show only text, not show data with style , because it ruined my layout:
Data is content's notes: <h1>some text....</h1>
My ...
0
votes
2
answers
230
views
Using ng-bind-html with textAngular
I have created a feature in my application wherein one can copy contents of an existing invoice to create a fresh new invoice. All other fields are getting copied. But the field 'note to customer' isn'...
1
vote
1
answer
705
views
TypeScript + AngularJS : Can't interact with the html generated by ng-bind-html
I have an html string that i build dynamically in my Component's controller. This way :
let strDl = this.domainsLabel.split('>');
angular.forEach(strDl, (element, index) => {
...
1
vote
1
answer
84
views
HTML string not binded with angular [duplicate]
<!DOCTYPE html
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<p ng-bind-html="myText"></p>
</div>
<script>
var app = angular.module("myApp", ['...
1
vote
3
answers
1k
views
AngularJS ng-bind-html not rendering list tags
I have a simple HTML document, like...
<ol>
<li><strong>Test 1</strong></li>
<li><strong>Test 2</strong></li>
</ol>
...and I want ...
2
votes
4
answers
4k
views
use service function with ng-bind-html in AngularJS
I'm trying to use a transformation function called highlightReview defined in a AngularJS service with the attribute ng-bind-html but I can't make it work.
See below for a sample :
function ...
2
votes
2
answers
6k
views
Use angular translate with parameters and HTML
I have a translation label with parameters and html :
{
"myLabel": "There is <b>{{param}}</b> value."
}
I don't arrive to pass my parameter and to get the HTML interpreted. I try ...
0
votes
1
answer
408
views
ng-repeat inside ng-bind-html
If I have a div as follows
<div ng-bind-html="myHtml"></div>
and myHtml is defined as follows
$scope.names = ['A','B','C'];
$scope.myHtml = "<p ng-repeat=\"name in names\" ng-bind=\"...
0
votes
1
answer
201
views
Angular ng-bind-html and ng-mouseover don't work (don't appears in code)
I try to add some code with ng-bind-html with included ng-mouseover. But the ng-mouseover part didn't appear (didn't work) in the code
Sample from angular plunker and add my piece of code:
ng-...
0
votes
0
answers
1k
views
Proper handling of UTF-8 encoded HTML special characters using AngularJS [duplicate]
Before marking this question as duplicate, let me say that I have
searched for hours but could not find any proper solution.
I have an web app built with AngularJS, using REST API. The JSON data ...
0
votes
1
answer
462
views
Force injected HTML to resize in a preview div Angular-UI
I have a preview feature in my Angular-UI modal view, inside:
<div class="wrapper bg-white b-b ng-binding" ng-bind-html="item.content" style="overflow:auto"></div>
I am currently using ...
0
votes
1
answer
1k
views
Angular bind html from Html entities
How to encode a HTML entities and display the HTML ? I have attached sample fiddle along this ticket
Controller:-
angular.module('myapp', ['ngSanitize'])
.controller('foo', function($scope) {
$...
1
vote
1
answer
1k
views
'ng-bind-html-unsafe' doesn't display anything
I'm displaying a string that has HTML code in it from the JSON.
Please check the 'Name' property in the 2nd object.
However, when I use 'ng-bind-html-unsafe' it doesn't display anything.
I've used ...
0
votes
2
answers
3k
views
ng-bind-html values to other html tags
I want to take data from ng-bind-html and bind it to some other html tags.Though i can directly use ng-bind-html for it. But is there any other way where we can use the binded html to other HTML tags?
...
0
votes
1
answer
444
views
Ng-repeat & Ng-bind-html
Does ng-repeat works inside ng-bind-html?
Where res2 is the StaticPage content. And res is a json file. Notice that I can get the variables from the scope (also print the json Array) but not ...
1
vote
1
answer
552
views
How to ng-model a text in a editable DIV rendered with ng-bind-html?
I am rendering HTML text in a div, which I make then editable. The user can modify the text, but is there a way to get back the text modified in HTML?
This is the fiddle I am trying to make working:
...
0
votes
1
answer
971
views
How to convert html to plain text in angularjs controller?
I am using ng-bind-html (with ngSanitize module) to display html as plain text in view. It is tied to the scope variable partyinfo.
<div class="panel panel-primary" ng-bind-html="partyinfo" ...
0
votes
0
answers
854
views
How can I use ng-bind-html as an element?
For an Angular 1.2 project, I'd like to render a subset of <td>s inside of a table row using ng-bind-html in order to reduce the number of watchers. I cannot easily render all <td>s this ...
0
votes
1
answer
515
views
Enable and disable ng-bind-html according to a $ctrl value in angular component
I'm using angualr component(1.5) .In My code i need to disable of using ng-bind-html directive if $ctrl.buttonTextStyle variable has no value.
<div>
<button id="saveBtn" class="pe-btn--...
0
votes
0
answers
104
views
Image is not rendering on html page
I have issue in rendering image on UI, I have used ng-bind-html. I am getting the text as it is but image is not shwoing.
In angular-
$scope.conversation.message= $sce.trustAsHtml(response);
In ...
0
votes
0
answers
352
views
how to set json response html(string) from controller to Angular UI?
Its printing html as it is(non html formatted data is shown in UI)
Tried with ng-bind-html but didnt work
Also tried using https://stackoverflow.com/a/25535684/6050814 not worked
$http({
...
0
votes
2
answers
450
views
ng-bind-html not working inside ui-view
I am developing an angular app with angular 1.4 and ui.router 0.2.8. I am using ng-bind-html to print error messages while form validation.But it is not working.
In my controller
$scope.nameError = $...
0
votes
1
answer
2k
views
ng-bind-html doesn't work with script
I am new to angular js.
So this might be very basic question
I have external API data which is a user generated content.
The client wants to dynamically show the content. In content, there is ...
0
votes
1
answer
491
views
ng-bind-html not recognizing ID names
I'm using ng-bind-html and it pulls in the HTML with class names, but the id names are all missing. What is causing this?
actual code example:
service partial example
var assets = {
'...