pythonee
V2EX  ›  Angular

angularJS 怎么实现拦截器

  •  
  •   pythonee · May 7, 2015 · 4068 views
    This topic created in 4056 days ago, the information mentioned may be changed or developed.
    现在有多个controller,想在所有controller前做一些操作,可以叫拦截器也可以叫过滤器,不知道怎么实现
    6 replies    2015-05-07 16:54:29 +08:00
    FrankFang128
        1
    FrankFang128  
       May 7, 2015
    router?
    pythonee
        3
    pythonee  
    OP
       May 7, 2015
    @winnie2012 要的不是httpProvider的,而是想在controller前执行或controller返回前执行的那种,类似aop
    akinoniku
        4
    akinoniku  
       May 7, 2015
    $routeChangeStart 吧
    learnshare
        5
    learnshare  
       May 7, 2015
    @akinoniku 这个可以做,controller 执行前就是 URL change 结束
    pythonee
        6
    pythonee  
    OP
       May 7, 2015
    @akinoniku 嗯,这个是我要的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   910 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 22:36 · PVG 06:36 · LAX 15:36 · JFK 18:36
    ♥ Do have faith in what you're doing.