I'm starting to learn AngularJS and I'm trying to use it in a MVC application. I have an MVC ViewModel with properties which I've populated from the database and I have a view which is bound to this ViewModel. So in a normal MVC view I can do something like @Model.UserBaseViewModel.FirstName. What I'm trying to do is have my data come come from the ViewModel and also be saved through the ViewModel but I want AngularJS to do things like Editing and displaying the data like this:
CODE
app.controller('ConsultantPersonalInformationController', function($scope, $filter, $http) {
$scope.user = {
id: 1,
firstName: @Model.UserBaseViewModel.FirstName,
lastName: @Model.UserBaseViewModel.LastName
};
//other code is here
});
I'm not sure if there's a way to do do this. Does AngularJS need to get and save the data being displayed or can I use MVC ViewModel properties instead.