Linked Questions
23 questions linked to/from How to bind raw html in Angular2
1096
votes
26
answers
758k
views
Angular HTML binding
I am writing an Angular application and I have an HTML response I want to display.
How do I do that? If I simply use the binding syntax {{myVal}} it encodes all HTML characters (of course).
I need ...
0
votes
1
answer
512
views
angular 2 bypassSecurity [duplicate]
I have a JSON file with data. In each object I've got a field the "description" with HTML tags, style, and text like this:
<div>__localname__</div>
<div style="color: #555; margin-top:...
2
votes
0
answers
123
views
Html currency symbols by hex code [duplicate]
I'm using Angular2.Dart and I need to render currency symbols inside table cells. I have all the hex codes available for all the currencies I need to be able to display as strings in a Currency class:
...
228
votes
16
answers
197k
views
How can I use/create dynamic template to compile dynamic Component with Angular 2.0?
I want to dynamically create a template. This should be used to build a ComponentType at runtime and place (even replace) it somewhere inside of the hosting Component.
Until RC4 I was using ...
146
votes
9
answers
78k
views
Equivalent of $compile in Angular 2
I want to manually compile some HTML containing directives. What is the equivalent of $compile in Angular 2?
For example, in Angular 1, I could dynamically compile a fragment of HTML and append it ...
162
votes
4
answers
211k
views
Dynamically add event listener
I am just starting to mess around with Angular 2 and I wonder if anyone can tell me the best way to dynamically add and remove event listeners from elements.
I have a component set up. When a certain ...
81
votes
2
answers
70k
views
In RC.1 some styles can't be added using binding syntax
Styles like
<div [style.background-image]="\'url(\' + image + \')\'">Background</div>
<div [style.transform]="rotate(7deg)"
are not added anymore
7
votes
1
answer
29k
views
How can I convert strings of HTML into HTML in my template (Angular2/TypeScript)?
I have this object in a dummy-data.ts file. Through a service I pull it successfully in to app.component.ts.
{name:"Object1",
prop1: {key:'value', key:'value'},
password: "P@ssword1",
...
5
votes
1
answer
8k
views
Angular2: How to display data in html format in angular2 data binding? [duplicate]
I have product data from database contains title, description...
The description is in html format string, like this:
<b>Name:</b> iPhone 5;<br>
<b>Membery:</b> 8GB;<...
1
vote
1
answer
8k
views
iframe not working in angular 5 it is showing the html contents
Here is the content that showing, i am trying to display the youtube content on my website but its not showing
Here the html that displaying on the browser
<iframe width="480" height="270" src="...
2
votes
3
answers
2k
views
Specifying style class for nested angular 2 component
Say inside my.component.html
<nested-component [class]="nestedClass"></nested-component>
Then when I want to use my component, I want to specify both their style classes:
<my-...
-1
votes
1
answer
2k
views
click button from template Angular 6
I have this function:
windowInfo_(marker, i, data) {
'<div style="' + this.content_ + '">' +
'<div>' +
'<img [src]="' + "'" + this.image + "'" + '"' + ' style="' + ...
0
votes
1
answer
3k
views
How to make anchor link with #id work as expected in Angular
My html content is generated by a markdown compiler in the backend, and what I want angular to do is to get data from server, dynamically render the content and display.
The mock markdown content may ...
2
votes
1
answer
2k
views
Set HTML space code in Typescript angular 2
I just a problem about how to set space to my value in html.
I have code :
setValuetoComboBox(test:string, lvl:number){
let lastTest:string;
let spaceString:string;
// 
...
1
vote
1
answer
2k
views
angular 4 load html template files from external folder
I developed an application with angular 4 for security reason and changing the template without compiling I am trying to find a way can change HTML and application use that. somehow I need to read ...