Passing data to mdDialog

前端 未结 5 1524
盖世英雄少女心
盖世英雄少女心 2021-01-31 13:37


Main listing page has edit button. Which opens details of the edited row.
Way-1: Now, if I set \"ctrl.parent.q_details.client_location\" it is bind wit

5条回答
  •  抹茶落季
    2021-01-31 14:33

    $scope.showPrompt = function(yourObject) {
    $mdDialog.show({
        templateUrl: 'app/views/your-dialog.tpl.html',
        locals: {
            callback: $scope.yourFunction // create the function  $scope.yourFunction = function (yourVariable) {
        },
        controller:  function ($scope, $mdDialog, callback) {
            $scope.dialog.title = 'Your title';
            $scope.dialog.abort = function () {
                $mdDialog.hide();
            };
            $scope.dialog.hide = function () {
    
                if ($scope.Dialog.$valid){
                    $mdDialog.hide();
                    callback($scope.yourReturnValue, likes the return of input field);
                }
            };
        },
        controllerAs: 'dialog',
        bindToController: true,
        clickOutsideToClose: true,
        escapeToClose: true
    });
    

    };

提交回复
热议问题