TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Iram Khan
NA
51
2k
Json data not formatting in view
Feb 2 2018 12:14 PM
I am fetching data in MVC and returning as Json. Although i am receving it in Angular controller but still getting Json in raw format.
Here is my MVC code...
public JsonResult Menu() {
var result = db.Departments.Include(y => y.Employee).ToList();
return Json(result, JsonRequestBehavior.AllowGet);
}
and here is my Angular Controller.
angular.module('ContactController', []).controller("ContactController", ['$scope', '$http', function ($scope, $http) {
$scope.model = {};
$http.get('/Contact/Menu').then(function(response) {
$scope.model = response.data;
})
}])
Here is View..
<tr ng-repeat="x in model">
<td>
{{x.Name}}
</td>
</tr>
and output in view is like this:
[{"Id":1,"Name":"Accounts","Employee":[]},{"Id":2,"Name":"Sales","Employee":[]}]
any idea what m i missing???
Reply
Answers (
2
)
From one view to another view.
i want to switch from jquery to angularsjs