【问题标题】:angular material design toast for forms用于表格的角材料设计吐司
【发布时间】:2015-03-17 15:02:27
【问题描述】:

我收到了一个用户登录表单,如果身份验证失败,它应该会显示一个 toast 消息。这是我的控制器。

我不想按照文档通过单击按钮来启动 toast。 toast 消息应该是用户名和密码不匹配。

控制器

app.controller('userCtrl',function($scope,$mdToast,$animate){
$scope.signin = function(credentials){
        console.log(credentials);
             $mdToast.show(
             $mdToast.simple()
        .content('Simple Toast!')
        .position($scope.toastPosition)
        .hideDelay(3000)
);
};
});

【问题讨论】:

    标签: angularjs toast material-design


    【解决方案1】:

    谢谢。我知道了。

     app.controller('userCtrl',function($scope,$mdToast,$animate){
    
    $scope.signin = function(credentials){
    
            console.log(credentials);
       $mdToast.show({
              position: "bottom right",
              template: "<md-toast>Toast !</md-toast>"
            });
    
    };
    
    
    });
    

    成功了。

    【讨论】:

      猜你喜欢
      • 2016-02-02
      • 1970-01-01
      • 2015-05-19
      • 2019-01-29
      • 2017-04-20
      • 2019-02-28
      • 1970-01-01
      • 2021-06-01
      • 2015-10-16
      相关资源
      最近更新 更多