As a newcomer to the AngularJS framework, I am faced with a challenge in pulling complex data from a Web API backend into my application's $scope. My goal is to utilize this front-end library to display this data in a calendar widget.
My issue lies in managing data from a Session table and a related Session_Instance table, which have a one-to-many relationship. While I can successfully retrieve the data using $http and store it in $scope with
$scope.sessions = angular.fromJson(data);
, I now seek guidance on organizing this data within an object, separating code out of the controller for better integration with Angular's dependency injection functionality. However, I am unsure about the best practices or methods to achieve this in Angular.
Is it feasible to create complex data models in Angular that utilize providers to maintain their accuracy within the app?