Javascript angularJS,一个部分或模式通知,加载几秒钟后消失
嗨,我目前正在使用angularJS nodeJs构建一个应用程序。其中一个功能是让个人能够从应用程序发送电子邮件。为此,他们点击一个按钮,打开一个模式窗口。他们填写表格,然后点击发送。这将导致电子邮件发送并关闭窗口。一旦模式窗口关闭,并且我从节点收到电子邮件成功发送的响应,我希望有一种简单的方式向用户显示气泡/模式或消息,简单地说“电子邮件已成功发送”。理想情况下,我希望这个消息出现10秒钟,然后消失Javascript angularJS,一个部分或模式通知,加载几秒钟后消失,javascript,angularjs,node.js,modal-dialog,partial-views,Javascript,Angularjs,Node.js,Modal Dialog,Partial Views,嗨,我目前正在使用angularJS nodeJs构建一个应用程序。其中一个功能是让个人能够从应用程序发送电子邮件。为此,他们点击一个按钮,打开一个模式窗口。他们填写表格,然后点击发送。这将导致电子邮件发送并关闭窗口。一旦模式窗口关闭,并且我从节点收到电子邮件成功发送的响应,我希望有一种简单的方式向用户显示气泡/模式或消息,简单地说“电子邮件已成功发送”。理想情况下,我希望这个消息出现10秒钟,然后消失 有人对如何以一种简单的方式实现这一点有什么建议吗?像往常一样打开模式,并在其控制器内使用$t
有人对如何以一种简单的方式实现这一点有什么建议吗?像往常一样打开模式,并在其控制器内使用
$timeout
调用$modalInstance.disease()代码>在x秒后。即
$timeout(function(){ $modalInstance.dismiss(); }, 10000);
像往常一样打开模态,并在其控制器内使用$timeout
调用$modalInstance.disease()代码>在x秒后。即
$timeout(function(){ $modalInstance.dismiss(); }, 10000);
像往常一样打开模态,并在其控制器内使用$timeout
调用$modalInstance.disease()代码>在x秒后。即
$timeout(function(){ $modalInstance.dismiss(); }, 10000);
像往常一样打开模态,并在其控制器内使用$timeout
调用$modalInstance.disease()代码>在x秒后。即
$timeout(function(){ $modalInstance.dismiss(); }, 10000);
如果您愿意添加jQuery(或者如果您的项目中已经包含了它),您可以使用。
甚至还有一个toastr实现可以与angularJS一起使用。如果您愿意添加jQuery(或者如果您的项目中已经包含了它),您可以使用它。
甚至还有一个toastr实现可以与angularJS一起使用。如果您愿意添加jQuery(或者如果您的项目中已经包含了它),您可以使用它。
甚至还有一个toastr实现可以与angularJS一起使用。如果您愿意添加jQuery(或者如果您的项目中已经包含了它),您可以使用它。
甚至还有一个toastr实现用于angularJS,。以下是一个
使用角烤面包机和模拟的失败和成功场景
HTML:
//电子邮件发送请求失败的模拟
myApp.factory("httpErrorInterceptor", ["$q", function ($q) {
var myInterceptor = {
"responseError": function () {
return $q.reject("This is not a real failure call -- simulation");
}
};
return myInterceptor;
}]);
myApp.config(["$httpProvider", function ($httpProvider) {
$httpProvider.interceptors.push("httpErrorInterceptor");
}]);
这是一个
使用角烤面包机和模拟的失败和成功场景
HTML:
//电子邮件发送请求失败的模拟
myApp.factory("httpErrorInterceptor", ["$q", function ($q) {
var myInterceptor = {
"responseError": function () {
return $q.reject("This is not a real failure call -- simulation");
}
};
return myInterceptor;
}]);
myApp.config(["$httpProvider", function ($httpProvider) {
$httpProvider.interceptors.push("httpErrorInterceptor");
}]);
这是一个
使用角烤面包机和模拟的失败和成功场景
HTML:
//电子邮件发送请求失败的模拟
myApp.factory("httpErrorInterceptor", ["$q", function ($q) {
var myInterceptor = {
"responseError": function () {
return $q.reject("This is not a real failure call -- simulation");
}
};
return myInterceptor;
}]);
myApp.config(["$httpProvider", function ($httpProvider) {
$httpProvider.interceptors.push("httpErrorInterceptor");
}]);
这是一个
使用角烤面包机和模拟的失败和成功场景
HTML:
//电子邮件发送请求失败的模拟
myApp.factory("httpErrorInterceptor", ["$q", function ($q) {
var myInterceptor = {
"responseError": function () {
return $q.reject("This is not a real failure call -- simulation");
}
};
return myInterceptor;
}]);
myApp.config(["$httpProvider", function ($httpProvider) {
$httpProvider.interceptors.push("httpErrorInterceptor");
}]);