joh*_*han 6 angularjs angular-material
我有一个Angular应用程序,并在其他组件中使用Angular-Material.是否可以使用延迟加载的TemplateUrl打开Angular Tab对话框,其中包含Angular表单?如果可能的话,你会如何参考这个表格?这是我用来打开对话框的一些代码:
$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.';
});
};
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激,谢谢
不确定我是否正确理解您的问题,但对于基本用途,请将您的上下文传递给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;
}
});
Run Code Online (Sandbox Code Playgroud)
...
$mdDialog.hide(info);
Run Code Online (Sandbox Code Playgroud)
请参阅此代码笔:
| 归档时间: |
|
| 查看次数: |
243 次 |
| 最近记录: |