Skip to content

Commit f087d5e

Browse files
authored
fix(viewDirective): add check for componentProvider
avoid extra trigger for $onInit (fixing angular-ui#3735)
1 parent 74f068e commit f087d5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/directives/viewDirective.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ function registerControllerCallbacks(
465465
cfg: Ng1ViewConfig
466466
) {
467467
// Call $onInit() ASAP
468-
if (isFunction(controllerInstance.$onInit) && !(cfg.viewDecl.component && hasComponentImpl)) {
468+
if (isFunction(controllerInstance.$onInit) && !((cfg.viewDecl.component || cfg.viewDecl.componentProvider) && hasComponentImpl)) {
469469
controllerInstance.$onInit();
470470
}
471471

0 commit comments

Comments
 (0)