Why am I unable to inject angular-cookies?

前端 未结 6 1821
礼貌的吻别
礼貌的吻别 2020-12-13 06:38

I have


    
    

        
6条回答
  •  一生所求
    2020-12-13 07:03

    I'm not sure what is your functional use-case but you can't inject services ($cookies is a service) inside config blocks. Only constants and providers can be injected inside config blocks.

    You can inject services into run blocks but I don't know if this helps you since I'm not sure what are your trying to do with those cookies.

    BTW: you seems to be mixing versions of the main angular file and the ngCookies module. This is not directly linked to your problem but this is rather odd.

提交回复
热议问题