O
O
okuznetsov12017-04-17 17:01:38
Angular
okuznetsov1, 2017-04-17 17:01:38

How to pass a variable containing text with tags from the controller to the template in angular2?

import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
import ...


@Component({
    selector: 'si-working-time-journal-calendar',
    templateUrl: './calendar.component.html',
    styleUrls: ['./calendar.component.css'],
})

export class WorkingTimeJournalCalendarComponent implements OnChanges {
    @Input() dateRange;
    @Input() employees;
    @Input() config;

    periodEmployeeAveraged = '<b>text</b>';

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Stroykin, 2017-04-17
@okuznetsov1

<p [innerHTML]="periodEmployeeAveraged"></p>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question