각도 재질의 md 대화 상자 기능을 사용하고 있지만 날짜 필터가 작동하는 데 문제가 있습니다. 어쩌면 누군가가 그것을 발견하고 그들이이 작업을하는 방법에 대한 아이디어가 있다면 알려주지 않을 수 있습니다. {{item.presentation.end_time}}과 {{confSessionObj.session_nr}}이 작동하고 있음을 알 수 있습니다. 그러나 각도 날짜 필터를 넣으면 인식하지 못합니다.각도 다이얼로그가 각도 필터를 인식하지 못합니다.
여기 내 코드가 있습니다.
JS
$scope.showAdvanced = function(ev, confSession) {
var sessionID = confSession.id;
$.ajax({
type: "GET",
url: "/session-detail.php",
data: {id: sessionID},
success: function(data, response){
data = data.replace(/\\n/g, "\\n")
.replace(/\\'/g, "\\'")
.replace(/\\"/g, '\\"')
.replace(/\\&/g, "\\&")
.replace(/\\r/g, "\\r")
.replace(/\\t/g, "\\t")
.replace(/\\b/g, "\\b")
.replace(/\\f/g, "\\f");
$scope.returnedObj = JSON.parse(data);
$mdDialog.show({
locals: { confSessionObj: confSession, returnedObj: $scope.returnedObj },
controller: DialogController,
targetEvent: ev,
template:
'<div class="md-dialog-container">' +
'<md-dialog aria-label="Session Detail">' +
'<form ng-cloak>' +
'<md-toolbar md-scroll-shrink>'+
'<div class="md-toolbar-tools">'+
'<h4 style="color: #fff;">Session Details</h4>'+
'</div>'+
'</md-toolbar>'+
'<md-dialog-content>'+
'<md-list-item>'+
'<div class="md-dialog-content" id="dialog">'+
'<p class="md-body-2"><span class="md-custom-title">Session Title:</span> {{confSessionObj.session_nr}} - {{confSessionObj.session_name}}</p>'+
'<table class="table table-bordered table-striped table-hover table-responsive" id="dialogtable">'+
'<tr id="theader">'+
'<thead>'+
'<th>Talk Title</th>'+
'<th>Start Time</th>'+
'<th>End Time</th>'+
'<th>Speaker Name</th>'+
'</thead>'+
'</tr>'+
'<tr ng-repeat="item in returnedObj">'+
'<td>{{item.presentation.title}}</td>'+
'<td>{{item.presentation.start_time | date: "MM/dd/yyyy h:mma"}}</td>'+
'<td>{{item.presentation.end_time | date: "MM/dd/yyyy h:mma"}}</td>'+
'<td>{{item.speakers.firstname}} {{item.speakers.lastname}}</td>'+
'</tr>'+
'</table>'+
'</div>'+
'</md-list-item>'+
'</md-dialog-content>'+
'<md-dialog-actions layout="row">'+
'<md-button class="md-raised" ng-click="cancel()">Close</md-button>' +
'</md-dialog-actions>'+
'</form>'+
'</md-dialog>'+
'</div>',
parent: angular.element(document.body),
preserveScope: true,
clickOutsideToClose:true,
fullscreen: $scope.customFullscreen
});
},
error: function(e){
console.log(e.message);
}
});
};
function DialogController($scope, $mdDialog, confSessionObj, returnedObj) {
$scope.confSessionObj = confSessionObj;
$scope.returnedObj = returnedObj;
$scope.cancel = function() {
$mdDialog.cancel();
};
}
모든 필터를로드/실행하지 못합니까? 대신에 간단한 '대문자'필터를 사용해보고 그 것이 작동하는지 확인할 수 있습니까? –
또한'item.presentation.end_time'이 어떻게 나오는지 보여주십시오. 날짜 형식이 잘못되어 날짜 필터가 실패한 것일 수 있습니다. –
피드백을 보내 주셔서 감사합니다. @ alexander-staroselsky. "대문자"필터를 시도하고 그 작동합니다. 또한'item.presentation.end_time'은 '2011 5/24/2017 1:10 pm'의 '2017-05-24 13 : 10'을 인쇄합니다. – missgg