Angularjs: Error: [ng:areq] Argument ‘HomeController’ is not a function, got undefined

This creates a new module/app: While this accesses an already created module (notice the omission of the second argument): Since you use the first approach on both scripts you are basically overriding the module you previously created. On the second script being loaded, use var myApp = angular.module(‘myApp’);.

AngularJS : Factory and Service?

Service vs Factory The difference between factory and service is just like the difference between a function and an object Factory Provider Gives us the function’s return value ie. You just create an object, add properties to it, then return that same object.When you pass this service into your controller, those properties on the object will now … Read more