
.l-main-section
  h2 onDestroy <span class="type">variable</span>
  p.location-badge.
    exported from <a href="/angular2/annotations.html">angular2/annotations</a>

  :markdown
    Notify a directive whenever a <a href='View-class.html'><code>View</code></a> that contains it is destroyed.
    
    ## Example
    
    ```
    @Directive({
      ...,
      lifecycle: [onDestroy]
    })
    class ClassSet {
      onDestroy() {
        // invoked to notify directive of the containing view destruction.
      }
    }
    ```

