pythonee
V2EX  ›  Angular

angularJS 怎么实现拦截器

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