In our MVC 5 project we use Angular. The following Razor works nicely:
@Html.EditorFor(x => x.FirstName,
new { required = "required", ng_model = "FirstName" })
However, if the MVC Model.FirstName is set to "Bob" when the page is rendered, the Input field is still blank.
If I set this in the Angular controller:
$scope.FirstName = "@(Model.FirstName)";
Then "Bob" appears.
My question is: Do I have to set the $scope.VARIABLE=MODEL.VARIABLE for every field in the UI, or can I tell Angular to respect what came over from ASP.NET MVC.
Angular is appearing to over write the [input value="Bob"] that MVC writes.