简体   繁体   English

Angular Toastr:发送到Toastr上的路径隐藏吗?

[英]Angular Toastr: send to path on toastr hidden?

I have an Angular 1.3 project, using ng-route. 我有一个使用ng-route的Angular 1.3项目。 I am using Angular Toastr for user notifications. 我正在使用Angular Toastr进行用户通知。

After the notification closes, I want to send the user to a path. 通知关闭后,我想将用户发送到路径。

With the following code, the even fires my function and displays the debug statement, but the browser does not navigate and no errors are shown. 使用以下代码,even会触发我的函数并显示debug语句,但是浏览器无法导航,也不会显示任何错误。 What did I miss? 我错过了什么?

  $scope.sendUsername = function() {
if ($scope.myForm.$valid) {
  toastr.success('We sent an email to (email address)', {
    onHidden: function() {
      $log.debug('foo');
      $location.path('/');
    }
  });
}
 };
toaster.pop('success',null, 'Candidate added successfully', null, '');
                              var delay=1000; //1 seconds

                             setTimeout(function(){
                             $location.path('/new location');          
                         }, delay); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM