Recently I came across the following in one of our projects. In one of our MVC views they are passing model data to an Angular controller through ngInit directive.In xxx.cshtml:<div ng-controller=AssessmentController     ng-init=Init('@Model.Status','@Model.ARN','@Model.AssessmentID','@Model.AssessorID',@Model.Contents, @Model.Date_of_Assessment.ToJsonTicks(),'@Model.HouseReferenceID',@Newtonsoft.Json.JsonConvert.SerializeObject(Model.House))>I pointed out that according to Angular documentation, ngInit directive is not to be used to to initialize controllers.Instead what I suggested was to send the ID in ngInit directive:<div ng-controller=AssessmentController     ng-init=Init('@Model.AssessmentID'>Then after that use $http service to get the remainder of data from the Angular controller.The developer is refusing my idea saying it's faster to just send all the data through ngInit directive instead of having to do another call to get the data inti the Angular controller.What do you think about this scenario? The only point I have right now is that this code is ugly and it not according to standards. How would you convince a developer to follow the path I suggested? Or am I completely wrong here?
Using ng-init to initialize data in Angular controller
mvc;angularjs