javascript - AngularJS: call factory from controller -
I am using the following link to use requirejs with angularjs
How do I I can use the service function that is defined in the Js \ services \ version.js
I have the following code in the services.
services.factory ('phone', ['$ resource', function ($ resource) {console.log ("factory");}]); I want to call this factory function in the controller. How to do this?
Firstly let your service "angular.module ();"
application. Controller ('myController', ['phone' ',' $ radius', function (phone, $ radius) {// your code here}]);
Comments
Post a Comment