Code Guru
Code Guru

Reputation: 15578

What is the calling order of angularjs functions (config/run/controller)?

There are

functions of angular.js. What is the calling order of all these modules?

Upvotes: 6

Views: 8618

Answers (1)

M. Junaid Salaat
M. Junaid Salaat

Reputation: 3783

Learning this I made a fiddle observing the behaviour by console.log. Its like

  • app config
  • app run
  • directive setup
  • directive compile
  • (app controller dependencies)
    • service
    • factory
    • inner factory
    • inner service
  • app controller
  • filter
  • directive linking
  • filter render (w.r.t the markup)

Observe yourself here (Check Console).

EDIT

New Fiddle with filters added

Upvotes: 16

Related Questions