...
Angular JS, Tutorials

Attribute property binding for background-image url in Angular

17 January 2019

In the Following example, we are going to applying background-image of a div to an @input value using angular directive [ngStyle]:

<div class="profile-image"
     [ngStyle]="{ 'background-image': 'url(' + image + ')'}">

Note: Here ‘image’ is a property of your component

Leave a Comments