Attribute property binding for background-image url in Angular 2
问题 I have been struggling to figure out the best way to dynamically change the background-image attribute in a number of Angular 2 components. In the following example, I am attempting to set the background-image of a div to an @Input value using [ngStyle] directive: import {Component, Input} from '@angular/core'; import { User } from '../models'; // exporting type aliases to enforce better type safety (https://github.com/ngrx/example-app) export type UserInput = User; @Component({ selector: