
committed by
Matias Niemelä

parent
99711b12f9
commit
e44f69c387
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import {DirectiveDef} from './interfaces/definition';
|
||||
import {LNodeFlags} from './interfaces/node';
|
||||
import {TNodeFlags} from './interfaces/node';
|
||||
import {HookData, LView, LifecycleStage, TView} from './interfaces/view';
|
||||
|
||||
/**
|
||||
@ -43,13 +43,13 @@ export function queueInitHooks(
|
||||
export function queueLifecycleHooks(flags: number, currentView: LView): void {
|
||||
const tView = currentView.tView;
|
||||
if (tView.firstTemplatePass === true) {
|
||||
const size = (flags & LNodeFlags.SIZE_MASK) >> LNodeFlags.SIZE_SHIFT;
|
||||
const start = flags >> LNodeFlags.INDX_SHIFT;
|
||||
const start = flags >> TNodeFlags.INDX_SHIFT;
|
||||
const end = start + (flags & TNodeFlags.SIZE_MASK);
|
||||
|
||||
// It's necessary to loop through the directives at elementEnd() (rather than processing in
|
||||
// directiveCreate) so we can preserve the current hook order. Content, view, and destroy
|
||||
// hooks for projected components and directives must be called *before* their hosts.
|
||||
for (let i = start, end = start + size; i < end; i++) {
|
||||
for (let i = start; i < end; i++) {
|
||||
const def = (tView.data[i] as DirectiveDef<any>);
|
||||
queueContentHooks(def, tView, i);
|
||||
queueViewHooks(def, tView, i);
|
||||
|
Reference in New Issue
Block a user