angular-svg-icon
angular-svg-icon copied to clipboard
Style not applied to element due to not detected changes
I am facing problem where svgStyle does not apply to element (sometimes) in cause of setSvg
called after changes of name
and no setStyle
called from SvgIconComponent
.
My case is that I am loading screen with empty icon status, then I update that status to proper icon. When I debug this code then everything goes fine until last step (everything is set as expected style is set before last step), the last step resets all svg elements to initial without setting style property.
Changes are reset in this.destroy()
and in below code changes
points to null
const changes = this.differ.diff(this._svgStyle);
console.log('differences', changes);
workaround for now is to set svg style manualy with ::ng-deep
.status-new {
color: #5f6c84;
svg {
width: 16px;
}
}
@Adam-Michalski - Could you provide a small example of the typescript and html code to reproduce this?