1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Angular 2 - innerHTML styling

Discussão em 'Angular' iniciado por Jakob Svenningsson, Setembro 24, 2024.

  1. I am getting chunks of HTML codes from HTTP calls. I put the HTML blocks in a variable and insert it on my page with [innerHTML] but I can not style the inserted HTML block. Does anyone have any suggestion how I might achieve this?

    @Component({
    selector: 'calendar',
    template: '<div [innerHTML]="calendar"></div>',
    providers: [HomeService],
    styles: [`h3 { color: red; }`]
    })


    The HTML that I want to style is the block contained in the variable "calendar".

    Continue reading...

Compartilhe esta Página