0
我设计了一个mdTast,用于同时显示拖曳Toast,但只有该操作具有传递的值,其他值仍然作为第一个敬酒。
看到我的代码
var setToaster = function(text,action,url,position) {
var toast = $mdToast.simple()
.textContent(text)
.action(action)
.position(position)
.hideDelay(false)
.highlightAction(true)
.highlightClass('md-accent')// Accent is used by default, this just demonstrates the usage.
// .position(pinTo);
return $mdToast.show(toast).then(function (response) {
if (response == 'ok') {
$location.url(url);
}
});
};
var setToaster2 = function(text,action,url,position) {
if (vm.viewForm == false) {
setToaster('Your Client History Form still not completed,Please Compelete it', 'Complete', '/client-history', 'top right')
}
if (vm.myVar.complete_profile == true) {
setToaster('Your profile is incomplete, Please Complete your profile', 'Go To Profile', '/user/profile', 'bottom right')
}
这有什么功能的问题,并举杯支持这样做呢?