title: Dynamically updating css in Angular 2
body: <p>Let's say I have an Angular2 Component</p>
  
  <pre><code>//home.component.ts
  
  import { Component } from 'angular2/core';
  
  @Component({
      selector: "home",
      templateUrl: "app/components/templates/home.component.html",
      styleUrls: ["app/components/styles/home.component.css"]
  })
  export class HomeComponent {
      public width: Number;
      public height: Number;
  } 
  </code></pre>
  
  <p>The template html file for this component</p>
  
  <pre><code>//home.component.html
  
  &lt;div class="home-component"&gt;Some stuff in this div&lt;/div&gt;
  </code></pre>
  
  <p>And finally the css file for this component</p>
  
  <pre><code>//home.component.css
  
  .home-component{
      background-color: red;
      width: 50px;
      height: 50px;
  }
  </code></pre>
  
  <p>As you can see there are 2 properties in the class, <code>width</code> and <code>height</code>. I would like the css styles for width and height to match the values of the width and height properties and when the properties update, the width and height of the div update. What is the proper way to accomplish this?</p>