点击一个按钮

时间:2018-06-29 11:24:14

标签: javascript angularjs twitter-bootstrap

我有这个引导程序模式代码

// when user selects a row from the table
$scope.selectCustomer = function (customer) {
    BootstrapDialog.confirm({
        title: 'Confirm customer selection',
        message: 'Are you sure that you want to select the customer <b>' + customer.FIRST_NAME + " " + customer.LAST_NAME + "</b> with Account ID " + customer.ACCOUNT_ID + "?",
        type: BootstrapDialog.TYPE_INFO, // <-- Default value is BootstrapDialog.TYPE_PRIMARY
        closable: true, // <-- Default value is false
        draggable: true, // <-- Default value is false
        btnCancelLabel: 'Cancel', // <-- Default value is 'Cancel',
        btnOKLabel: 'Ok', // <-- Default value is 'OK',
        btnOKClass: 'btn-primary', // <-- If you didn't specify it, dialog type will be used,
        callback: function(result) {
            // result will be true if button was click, while it will be false if users close the dialog directly.
            if(result) {
                $scope.$apply(function () {
                    $scope.accountID = customer.ACCOUNT_ID; // accountID is mapped to IPP
                    console.log($scope.accountID);
                });
            }
        }
    });
};

通常我将对按钮执行此操作以使用自定义指令:

 <button custom-directive="complete" class="btn btn-success"></button>

如何将值分配给accountID,然后触发此自定义指令custom-directive="complete"

0 个答案:

没有答案