How to pass Object to NgStyle directive in Angular 2?
<p>I'm trying to use <code>NgStyle</code> directive with an object variable like so:</p>

<pre><code>@Component({
      template: `
            &lt;div [ngStyle]="object"&gt;
              some test text
           &lt;/div&gt;`
    })

export class example {
    private object: string = "{background-color: 'white'}";
}
</code></pre>

<p>I also tried with <code>object = "background-color: 'red'"</code> and <code>[ngStyle]="{object}"</code>, but it seems like it doesn't work. I get the message error:</p>

<blockquote>
  <p>Error: Uncaught (in promise): Error caused by: Cannot find a differ supporting object '{color: 'white'}'(…)consoleError @ VM1051 zone.js@0.6.21?main=browser:346_loop_1 @ VM1051 zone.js@0.6.21?main=browser:371drainMicroTaskQueue @ VM1051 zone.js@0.6.21?main=browser:375ZoneTask.invoke @ VM1051 zone.js@0.6.21?main=browser:297</p>
</blockquote>

<p>What am I doing wrong?</p>