Passing data to mdDialog

前端 未结 5 1525
盖世英雄少女心
盖世英雄少女心 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:24

    The ES6 TL;DR way

    Create a controller with scope variables on the fly

    let showDialog = (spaceApe) => {
        $mdDialog.show({
            templateUrl: 'dialog.template.html',
            controller: $scope => $scope.spaceApe = spaceApe
        })
    }
    

    Template

    Voilà, spaceApe can now be used in the dialog template

    
        
             {{spaceApe | json}} 
        
    
    

提交回复
热议问题