生成的控制器的一部分mdDialog
看起来像
$scope.removeAttendee = function(item) {
console.log(item);
$mdDialog.show({
controller: DialogController,
templateUrl: 'views/removeMsg.tmpl.html',
parent: angular.element(document.body),
clickOutsideToClose:true,
controllerAs: 'ctrl',
fullscreen: $scope.customFullscreen, // Only for -xs, -sm breakpoints.
locals: {item: item}
})
和控制器mdDialog
:
function DialogController($scope, $mdDialog) {
var attendee = this;
$scope.hide = function() {
$mdDialog.hide();
};
$scope.cancel = function() {
$mdDialog.cancel();
};
$scope.save = function(response) {
$mdDialog.hide(response);
};
$scope.remove = function(response) {
$mdDialog.hide(response);
};
}
removeMsg.tmpl.html
有那个代码
<p>You are going to remove {{ ctrl.item.firstName }} {{ ctrl.item.lastName }} from the lunch list.</p>
但即使我将代码更改为简单的东西,我也无法显示相关值
locals { item: "test" }
和相关部分
{{ ctrl.item }}
有什么建议为什么我没有显示这些值?