2015-04-19 13:53:18 -07:00
|
|
|
|
|
|
|
.l-main-section
|
|
|
|
h2 onDestroy <span class="type">variable</span>
|
2015-04-22 08:06:51 -07:00
|
|
|
p.location-badge.
|
2015-04-23 08:27:36 -07:00
|
|
|
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
|
2015-04-19 13:53:18 -07:00
|
|
|
|
|
|
|
:markdown
|
2015-04-23 08:27:36 -07:00
|
|
|
Notify a directive whenever a <a href="View-class.html"><code>View</code></a> that contains it is destroyed.
|
2015-04-19 13:53:18 -07:00
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
```
|
|
|
|
@Decorator({
|
|
|
|
...,
|
|
|
|
lifecycle: [onDestroy]
|
|
|
|
})
|
|
|
|
class ClassSet {
|
|
|
|
onDestroy() {
|
|
|
|
// invoked to notify directive of the containing view destruction.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|