Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

There are

  • controllers
  • constants
  • directives
  • services
  • factory
  • run
  • config
  • filters

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

like image 567
Sunil Garg Avatar asked Jul 14 '16 12:07

Sunil Garg


1 Answers

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

like image 95
M. Junaid Salaat Avatar answered Oct 01 '22 01:10

M. Junaid Salaat