0
我試圖用一些關於某些命令的信息顯示mdDialog。當我將它作爲主html頁面的一部分時,此代碼正常工作。試圖在對話框中顯示相同的信息,它不會顯示錶頭以外的任何內容。將對象傳遞給mdDialog模板的問題Url
任何想法發生了什麼?
function showDetails(event, order) {
console.log(order);
//show details
$mdDialog.show({
controller: DialogController,
templateUrl: 'app/orders/directives/orderDetails.html',
parent: angular.element(document.body),
targetEvent: event,
clickOutsideToClose: true,
escapeToClose: true,
locals:{
itemsParent: order,
three: 3
},
fullscreen: $scope.customFullscreen // Only for -xs, -sm breakpoints.
})
.then(function(answer) {
}, function() {});
};
function DialogController($scope, $mdDialog, itemsParent) {
console.log(itemsParent);
$scope.hide = function() {
$mdDialog.hide();
};
$scope.cancel = function() {
$mdDialog.cancel();
};
$scope.answer = function(answer) {
$mdDialog.hide(answer);
};
}
的templateurl:
<form>
<md-toolbar>
<div class="md-toolbar-tools">
<h2> Order Id:{{ itemsParent.orderid }}</h2>
<span flex></span>
<md-button class="md-icon-button" ng-click="cancel()">
<i class="material-icons">clear</i>
</md-button>
</div>
</md-toolbar>
<md-dialog-content>
<div class="md-dialog-content">
<p>
Ahsan:
{{three}}
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Product Id</th>
<th>Name</th>
</tr>
</thead>
<tr ng-repeat="product in itemsParent.products">
<td>
<div>{{ product.productid }}</div>
</td>
<td>
<div>{{ product.name }}</div>
</td>
</tr>
</table>
</p>
</div>
</md-dialog-content>
<md-dialog-actions>
<md-dialog-actions layout="row">
<span flex></span>
<md-button class="md-primary md-raised" ng-click="answer(close)">
Close
</md-button>
</md-dialog-actions>
</md-dialog-actions>
第一部分使它工作得很好。謝謝。 – Ahsan