0
我正在使用$mdDialog
對話框,並希望在我的對話框模板中使用動態頭。 我想在彈出模板中發送數據。 這是我的對話框代碼。
$scope.showAdvanced = function (ev, Title) {
$rootScope.tt = Title;
var useFullScreen = ($mdMedia('sm') || $mdMedia('xs')) && $scope.customFullscreen;
$mdDialog.show({
controller: DialogController,
templateUrl: 'setting/dialog1.tmpl.html',
parent: angular.element(document.body),
targetEvent: ev,
clickOutsideToClose: true,
fullscreen: useFullScreen,
locals: { Title: Title },
})
.then(function (answer) {
$scope.status = 'You said the information was "' + answer + '".';
}, function() {
$scope.status = 'You cancelled the dialog.';
});
$scope.$watch(function() {
return $mdMedia('xs') || $mdMedia('sm');
}, function (wantsFullScreen) {
$scope.customFullscreen = (wantsFullScreen === true);
});
};
我的對話控制器
function DialogController($scope, $mdDialog) {
$scope.Title = Title;
$scope.hide = function() {
$mdDialog.hide();
};
$scope.cancel = function() {
$mdDialog.cancel();
};
$scope.answer = function (answer) {
$mdDialog.hide(answer);
};
}
現在我想在dialog1.tmpl.html
模板使用的標題。
如何標題將HTML templateUrl使用: '設置/ dialog1.tmpl.html' – user3248761
在HTML中的{{title}} –
但標題被保留word for html可以使用不同的變量名稱 –