feat(core): support ngOnDestroy
on providers of a directive.
Such providers also become eager as they will be instantiated anyways on destruction.
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
import {CompileDirectiveMetadata} from '../compile_metadata';
|
||||
import {ListWrapper, StringMapWrapper} from '../facade/collection';
|
||||
import {StringWrapper, isBlank, isPresent} from '../facade/lang';
|
||||
import {identifierToken} from '../identifiers';
|
||||
import * as o from '../output/output_ast';
|
||||
import {BoundEventAst, DirectiveAst} from '../template_parser/template_ast';
|
||||
|
||||
@ -134,8 +135,9 @@ export function collectEventListeners(
|
||||
compileElement, hostEvent.target, hostEvent.name, eventListeners);
|
||||
listener.addAction(hostEvent, null, null);
|
||||
});
|
||||
ListWrapper.forEachWithIndex(dirs, (directiveAst, i) => {
|
||||
var directiveInstance = compileElement.directiveInstances[i];
|
||||
dirs.forEach((directiveAst) => {
|
||||
var directiveInstance =
|
||||
compileElement.instances.get(identifierToken(directiveAst.directive.type));
|
||||
directiveAst.hostEvents.forEach((hostEvent) => {
|
||||
compileElement.view.bindings.push(new CompileBinding(compileElement, hostEvent));
|
||||
var listener = CompileEventListener.getOrCreate(
|
||||
|
Reference in New Issue
Block a user