zoukankan      html  css  js  c++  java
  • 传递参数,封装函数

    .run(['$rootScope', function ($rootScope) {
        $rootScope.alert = function (textContent(参数), toastClass, hideDelay) {
            $mdToast.show(
                $mdToast.simple()
                    .textContent(textContent)(对应参数)
                    .action('ok')
                    .toastClass(toastClass)
                   
    .position('bottom right')
                    .hideDelay(hideDelay || 3000)
            );
        }

     

    self.send = function () {
        homeSvc.postHomeList(self.data.message).then(function (result) {
            $rootScope.alert('Send notifications successfully传递的值的内容 'toast-success')(第一个参数内容必传)
            //传输成功
    $mdToast.show(
             $mdToast.simple()
                .textContent('Send notifications successfully')
                .action('ok')
                .toastClass('toast-success')(使用参数textContent,toastClass,hideDelay传递值中所需要的内容)
                
    .position('bottom right')
                .hideDelay(3000)
             );

       
    }, function (error) {
            $rootScope.alert('Failed to send notification', 'toast-error')
            //传输失败
       
    })

    }
  • 相关阅读:
    例6-5
    例7-1+7-2
    例6-2+6-3
    习题二(3)
    习题二(1)
    课堂作业4
    课堂作业3
    实验三 利用循环计算n个圆柱体体积。
    实验三 编写求圆面积的程序,要求当输入的半径r<=0时,提示输入错误,要求r为浮点型,r的数值是动态的由键盘输入;
    心得3
  • 原文地址:https://www.cnblogs.com/ncloud/p/6768695.html
Copyright © 2011-2022 走看看