SQL Serverからの値を使用してページに日付と時刻を印刷しようとしています。返される日付の書式はそうのようなものです:anglejsで日付が定義されていません
/Date(1510563600000)/
角度
$filter('date')(date, format, timezone)
$scope.GetTimelineByUserIdAndProjectId = function (userId, projectId) {
var obj = { "userId": userId, "projectId": projectId }
$http.post('/Admin/GetTimelineByUserIdAndProjectId', obj)
.then(function (response) {
$scope.userTimeline = response.data;
})
}
HTML
<ul class="timeline timeline-inverse" ng-repeat="u in userTimeline">
<li class="time-label">
<span class="bg-red">
{{u.StartDateTime | date:'medium'}}
</span>
</li>
<li>
<i class="fa fa-clock-o bg-gray"></i>
</li>
日付形式を日/月/年時:分にしたい。
私はこのプログラムを実行すると、私は$フィルタが、私はこのように私のコントローラに置くように定義されていないしまった。
var app = angular.module('adminApp', []);
app.controller('adminController', function ($scope, $http, $filter) {
をしかし、それは、私が私にangular.js:14642 ReferenceError: date is not defined
の原因となるよう
は、あなたのケースでは、あなたのアプリにリンクされていないフィルタを作成していますか? datetimeデータ型を使用しませんでしたか? – JkAlombro
私のSqlServerの日付形式はdatetimeです。 –