角形对话框

约翰

我有一个Angular应用,正在其他组件中使用Angular-Material。是否可以打开包含懒惰加载的包含Angular表单的TemplateUrl的Angular Tab对话框?如果可能的话,您将如何引用此表格?这是我用来打开对话框的一些代码:

    $scope.showTabDialog = function(ev) {

        $mdDialog.show({
                controller: DialogController,
                templateUrl: 'pages/properties/tabDialog.tmpl.html',
                parent: angular.element(document.body),
                targetEvent: ev,
                clickOutsideToClose:true
            })
            .then(function(answer) {
                $scope.status = 'You said the information was "' + answer + '".';
            }, function() {
                $scope.status = 'You cancelled the dialog.';
            });
    };

任何帮助将不胜感激,谢谢

马利克斯

不确定我是否正确理解了您的问题,但对于基本用途,请将您的上下文locals信息传递给并将其信息返回给$mdDialog.hide

    $mdDialog.show({
      targetEvent: $event,
      template: dialogContent,
      controller: 'DialogController',
      locals: { info: $scope.info }
    }).then(function(info) {
        if(info) {
          $scope.info.userName = info.userName;      
        }
      });

...

$mdDialog.hide(info);

看到此密码笔:

http://codepen.io/anon/pen/BjqzJR

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章