I'm a beginner on angular. I've got a need to make multiple webservice calls and then bootstrap my model. I've tried placing the following code inside my function that is executed after all webservices have run.
var myApp = angular.module('myApp', [])
myApp.controller('Ctrl', ['$scope', function ($scope) {
$scope.obj = model
}]);
angular.element(document).ready(function () {
angular.bootstrap(document, ['myApp']);
});
But I receive the following exception.
[$injector:modulerr] Failed to instantiate module myApp due to: [$injector:nomod] Module 'myApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
My code still works, but I want to get rid of the exception and more importantly learn how the angular code should be structured when the bootstrapping is delayed.
I don't know if this will help, but I'm including it in case.
<div ng-app ng-controller="Ctrl">
<div ng-repeat="o in obj track by $index">
</div>
<input id="Model" type="hidden" value="{{obj}}" />
</div>