.config, .run, AppCtrl - where to put routes?

前端 未结 2 806
后悔当初
后悔当初 2021-02-01 16:27

I wanted to find out the difference between the .config and .run functions in AngularJS. I was using my .config for setting up routes, but

2条回答
  •  野的像风
    2021-02-01 17:33

    The .config block is executed during the provider registration and configuration phase. It' a module level block.

    The.run block is executed after the config block. It's used to inject services and constants.

提交回复
热议问题