angularjs函数(config / run / controller)的调用顺序是什么? [英] What is the calling order of angularjs functions (config/run/controller)?

查看:214
本文介绍了angularjs函数(config / run / controller)的调用顺序是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  • 控制器

  • 常数

  • 指令

  • 服务

  • factory

  • 运行

  • config

  • 过滤器

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

angular.js 。所有这些模块的调用顺序是什么?

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

推荐答案

学习这个我通过的console.log 。它就像

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


  • app config

  • app run

  • 指令设置

  • 指令编译

  • (app控制器依赖项)


    • 服务

    • factory

    • 内部工厂

    • 内部服务

    • app config
    • app run
    • directive setup
    • directive compile
    • (app controller dependencies)
      • service
      • factory
      • inner factory
      • inner service

      观察自己此处(检查控制台)。

      Observe yourself here (Check Console).

      编辑

      小提琴,带过滤器添加了

      这篇关于angularjs函数(config / run / controller)的调用顺序是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆