我正在尝试将表单输入传递给我的对话框(例如标题).问题是:它没有得到表格$scope.
如果我将$scope控制器设置为sinde,它将显示正常(参见$scope.text例如).但是,如果我尝试获取表单$scope(请参阅`$ scope.taskTitle),它就不会显示任何内容.看我的代码:
JavaScript的
app.controller('tasksCtrl', ['$scope', '$mdDialog', function($scope, $mdDialog){
$scope.teste = 'Just a test, dude';
$scope.expandTask = function() {
$mdDialog.show({
clickOutsideToClose: true,
controller: DialogController,
scope: $scope,
preserveScope: true,
templateUrl: 'models/dialog.tmpl.php',
locals: {
id: $scope.tasklist.id,
title: $scope.taskTitle
}
});
}
function DialogController($scope, $mdDialog, id, title) {
$scope.id = id;
$scope.title = title;
$scope.hide = function() {
$mdDialog.hide();
};
$scope.cancel = function() {
$mdDialog.cancel();
};
}
}]);
Run Code Online (Sandbox Code Playgroud)
HTML
<div class="input-container float-icon" flex="100" layout="row" ng-repeat="task …Run Code Online (Sandbox Code Playgroud)