How pass data to $mdDialog in angular material

前端 未结 3 1808
闹比i
闹比i 2020-12-20 19:08

I want to pass some data to $mdDialog. In fact, I have two controllers in a separate file. Here is my controller code

function openDialog(id) {
        $mdDi         


        
3条回答
  •  心在旅途
    2020-12-20 19:24

    Take the fast route!

    openDialog = (items) => 
        $mdDialog.show({
            templateUrl: 'view/profile.html',
            controller: $scope => $scope.items = items
        })
    

    $scope.items can now be used in the dialog template ☺

提交回复
热议问题