/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { DoCheck, ElementRef, KeyValueDiffers, Renderer } from '@angular/core'; /** * The `NgStyle` directive changes styles based on a result of expression evaluation. * * An expression assigned to the `ngStyle` property must evaluate to an object and the * corresponding element styles are updated based on changes to this object. Style names to update * are taken from the object's keys, and values - from the corresponding object's values. * * ### Syntax * * - `
` * - `` - here the `styleExp` must evaluate to an object * * ### Example ([live demo](http://plnkr.co/edit/YamGS6GkUh9GqWNQhCyM?p=preview)): * * ``` * import {Component} from '@angular/core'; * import {NgStyle} from '@angular/common'; * * @Component({ * selector: 'ngStyle-example', * template: ` *