【问题标题】:Angular Js redirect with toast messageAngular Js 重定向与 toast 消息
【发布时间】:2017-03-29 07:21:57
【问题描述】:

当我单击带有角度页面的 html 上的按钮时,我需要重定向到其他页面。 我使用一个 javascript 函数并在其中调用 $location.path('/newValue') 这工作正常,但我看不到 toast page 1 成功消息。 我需要显示 toast 消息并重定向到页面(或显示 toast 消息,等待 1 秒并重定向到页面)。 我该怎么做?

谢谢

【问题讨论】:

  • 你能发一些代码吗?
  • 请让我们知道您到目前为止所做的尝试。发布您的代码或创建一个小提琴并链接它。
  • 我有 $http.get() 调用成功我有 toastr.success('Success') 和 $location.path('/newValue')

标签: angularjs html toast


【解决方案1】:
toastr.info("Toast message here...");    
$timeout(function() {
    $location.path('/newValue');
}, 1000);

【讨论】:

  • 很高兴为您提供帮助:)
猜你喜欢
  • 2017-10-29
  • 2011-06-09
  • 2017-10-14
  • 2020-07-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-08-22
  • 2010-09-14
相关资源
最近更新 更多