23 lines
479 B
Plaintext
23 lines
479 B
Plaintext
|
|
||
|
.l-main-section
|
||
|
h2 onDestroy <span class="type">variable</span>
|
||
|
p(class="module") exported from <a href="/angular2/annotations">angular2/annotations</a>
|
||
|
|
||
|
:markdown
|
||
|
Notify a directive whenever a [View] that contains it is destroyed.
|
||
|
|
||
|
## Example
|
||
|
|
||
|
```
|
||
|
@Decorator({
|
||
|
...,
|
||
|
lifecycle: [onDestroy]
|
||
|
})
|
||
|
class ClassSet {
|
||
|
onDestroy() {
|
||
|
// invoked to notify directive of the containing view destruction.
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|