I have an angular app where i am getting data from a service.
My controller app.js is as follows:
var app = angular.module('myapp', ['ui.bootstrap', 'jsonService']);
app.controller('mycontroller', function(MyService, $scope, $modal, $log, $http) {
$scope.profileid=3619;
MyService.getItems($scope.profileid,function(data){
$scope.profiledata = data;
});
});
The json object i get in the data looks as follows:
[
{
"profile_id": 3619,
"student_id": "554940",
"first_name": "Samuel",
"last_name": "Haynes",
"date_of_birth": "2002-03-08T06:00:00Z"
}
]
Here the date_of_birth
is a DateTime field. When i am trying to display these values in a html as follows :
<label for="lastName">Student Last Name</label>
<input type="text" class="form-control" id="lastName" ng-model="profiledata[0].last_name" placeholder="Last Name" />
<label for="dob">Date of Birth</label>
<input type="date" class="form-control" id="dob" ng-model="profiledata[0].date_of_birth" />
Here, the last name displays fine in the textbox. But the date does not work. How do i display the values for the date?