angular - Angular2 innerHtml constantly updating -
i think more of style question want make sure doing correctly.
i have endpoint calling annoyingly returning svg image instead of full jpeg or png , need display on page. created service calls out , grabs svg. service gets called method in component called getimage(id).
in html have like:
<div [innerhtml]="getimage(id)></div>
one thing noticed can't inspect svg in chrome because it's updating. wondering if problem , if how fix it? looks it's calling update method nothing has changed on page (as far can tell) change detection shouldn't triggered?
example comment:
import { ..., oninit, ... } '@angular/core' @component({ ... }) export class ...component implements oninit { private image: string; constructor(...) { ... } public ngoninit(): void { this.getimage(1); //get id somewhere } private getimage(id): void { ... this.image = ...; } }
html
<div [innerhtml]="image"></div>
Comments
Post a Comment