Pass input value to $mdDialog

后端 未结 2 730
鱼传尺愫
鱼传尺愫 2021-01-15 18:32

I\'m trying to pass a form input to my dialog (as title for example). The problem is: it don\'t get the form $scope.

If I set the $scope si

2条回答
  •  星月不相逢
    2021-01-15 19:06

    Keep it minimal

    and create a controller with scope variables on the fly

    $scope.expandTask = (e, task) =>
        $mdDialog.show({
            templateUrl: 'dialog.template.html',
            controller: $scope => $scope.taskName = task.name
        })
    

    taskName is now a $scope variable and can be used in the dialog template

提交回复
热议问题