
p.location-badge.
  exported from <a href='../core'>angular2/core</a>
  defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/directives/ng_class.ts#L16-L134">angular2/src/core/directives/ng_class.ts (line 16)</a>

:markdown
  Adds and removes CSS classes based on an {expression} value.
  
  The result of expression is used to add and remove CSS classes using the following logic,
  based on expression's value type:
  - {string} - all the CSS classes (space - separated) are added
  - {Array} - all the CSS classes (Array elements) are added
  - {Object} - each key corresponds to a CSS class name while values
  are interpreted as {boolean} expression. If a given expression
  evaluates to {true} a corresponding CSS class is added - otherwise
  it is removed.
  
  # Example:
  
  ```
  <div class="message" [ng-class]="{error: errorCount > 0}">
      Please check errors.
  </div>
  ```
  
  

.l-main-section
  h2 Annotations
  .l-sub-section
    h3.annotation Directive
    pre.prettyprint
      code.
        @Directive({selector: &#39;[ng-class]&#39;, properties: [&#39;rawClass: ng-class&#39;, &#39;initialClasses: class&#39;]})


.l-main-section
  h2 Members
  .l-sub-section
    h3#constructor constructor

    
    pre.prettyprint
      code.
        constructor(_iterableDiffers: IterableDiffers, _keyValueDiffers: KeyValueDiffers, _ngEl: ElementRef, _renderer: Renderer)
    
    :markdown




  .l-sub-section
    h3#initialClasses initialClasses

    
    :markdown





  .l-sub-section
    h3#rawClass rawClass

    
    :markdown





  .l-sub-section
    h3#doCheck doCheck

    
    pre.prettyprint
      code.
        doCheck()
    
    :markdown





  .l-sub-section
    h3#onDestroy onDestroy

    
    pre.prettyprint
      code.
        onDestroy()
    
    :markdown




