加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

AngularJS $routeChangeSuccess回调参数

发布时间:2020-12-17 09:17:44 所属栏目:安全 来源:网络整理
导读:我是AngularJS的新手,并且有关于事件监听器的文档感到困惑. 该文档列出了 $routeChangeSuccess 事件的以下内容: $routeChangeSuccess Broadcasted after a route dependencies are resolved. ngView listens for the directive to instantiate the controll
我是AngularJS的新手,并且有关于事件监听器的文档感到困惑.

该文档列出了$routeChangeSuccess事件的以下内容:

$routeChangeSuccess Broadcasted after a route dependencies are
resolved. ngView listens for the directive to instantiate the
controller and render the view.

Type:

broadcast Target:

root scope

但是,它没有引用传递给回调函数的任何参数.然而,我在这里看到的大多数示例都有类似的回调函数列表:

$rootScope.$on("$routeChangeSuccess",function(event,next,current) {
   ...
});

根据AngularJS文档,所有回调都有第一个参数作为事件.我明白了.但是下一个和现在来自哪里?在任何文件中列出了哪些?

它的文件记载在版本少于1.2,看到这个 old documentation.但似乎他们没有注意到他们的广播事件的回调签名丢失.另一方面,如果您不介意从他们的github资源库中读取,可以查看此 line here的$routeChangeSuccess回调参数.

更新:
对于Route对象,实际上可以参考$route属性documented here.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读