Skip to content

[innerHTML] not working when defining PolymerElement #137

@BorntraegerMarc

Description

@BorntraegerMarc

So there is a bug (?) when using angular-polymer lib: The html attribute [innerHTML] can't be used anymore. Take out the PolymerElement('paper-icon-button') line in app.module.ts and everything works as expected. Does anybody know why this happens?

Here is the proof:
app.module.ts:

import {NgModule, Pipe, PipeTransform} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {PolymerElement} from '@vaadin/angular2-polymer';
import {AppComponent} from './app.component';

@NgModule({
    declarations: [
        AppComponent,
        PolymerElement('paper-icon-button')
    ],
    imports: [
        BrowserModule
    ],
    bootstrap: [AppComponent]
})
export class AppModule {
}

app.component.ts:

import {Component} from '@angular/core';

@Component({
    selector: 'my-app',
    template: `
    <p>asdf</p>
    <p [innerHTML]="'<b>bold text</b>'"></p> <!-- Not displayed at all even though a link should be there -->
    <b>bold text 2</b> <!-- Correct behaviour -->
    `
})
export class AppComponent {
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions