我怎样才能触发事件时的角度JS路径模板已经加载 [英] How can I trigger an event when an angular JS route template has been loaded

查看:109
本文介绍了我怎样才能触发事件时的角度JS路径模板已经加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何当一个角的路线已经呈现其观点,触发一个事件?我想路由应用程序,并在所呈现的模板的最后,我想它触发一个事件查看幻灯片开放,使用户体验心不是那么苛刻。当你点击一个链接路线chnages这么快。我基本上希望让用户体验更加流畅。

Does anyone know how to trigger an event when an angular route has rendered its view? I'd like to route the application and at the end of the template being rendered I would like it to trigger an event to slide the view "open", so that the User Experience isnt so harsh. When you click on a link the route chnages so quick. I basically want to make the User Experience smoother.


  1. 点击图片

  2. 路由应用程序(但该视图有一类显示器都没有

  3. 当视图加载完成,然后我想触发一个事件

  4. 事件触发的侦听器,使我的标记滑下和开拓。

任何想法?

推荐答案

这是不是做你后?

$scope.$on('$routeChangeSuccess', function () {
  // run some code to do your animations
});

转到 http://docs.angularjs.org/api/ 并看看 $路线(下ngRoute模块LHS菜单)

Go to http://docs.angularjs.org/api/ and take a look at $route (LHS menu under ngRoute module)

或者看看这个问题,我问.... AngularJS - 动画NG-视图过渡

Or take a look at this question I asked....AngularJS - Animate ng-view transitions

这篇关于我怎样才能触发事件时的角度JS路径模板已经加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆