You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
date: 2015-10-05
title: order of angular controller's initialisation
summary: I'm gonna explain order of angular controller's initialisation
slug: order-of-angular-controller
lang: en-US
tags: [javascript,angularjs]
Outline
Angular controllers are initialized from parent to child.
So child controllers can not get any event from parent controller when parent controller is initialized.
Controller's code is really simple. They outpu their name in conole after initialized.
In this sample, controller are declared from thirdController, secondController, firstController in order.
Because Angular controller are initialized from parent dom to child dom regardless of the declared order.
So be careful childredn controllers (thirdController, secondController) can not get any event from parent controller when parent controller is initialized (child controllers are not initialized).
The text was updated successfully, but these errors were encountered:
date: 2015-10-05
title: order of angular controller's initialisation
summary: I'm gonna explain order of angular controller's initialisation
slug: order-of-angular-controller
lang: en-US
tags: [javascript,angularjs]
Outline
Angular controllers are initialized from parent to child.
So child controllers can not get any event from parent controller when parent controller is initialized.
Detail
This is simple sample.
Controller's code is really simple. They outpu their name in conole after initialized.
In this sample, controller are declared from
thirdController
,secondController
,firstController
in order.But their names outputed in conole are bellow.
Because Angular controller are initialized from parent dom to child dom regardless of the declared order.
So be careful childredn controllers (
thirdController, secondController
) can not get any event from parent controller when parent controller is initialized (child controllers are not initialized).The text was updated successfully, but these errors were encountered: