My app.js contains
var app = angular.module(\'myApp\', []).
config([\'$routeProvider\', function ($routeProvider, $http) {
...
}]);
Servic
Just as an added clarification on Brian's answer, if you wanted to still have your code call MyService.addNums you could use the following:
app.service('MyService', function() {
var result = {};
result.addNums = function (text) {
return text + "123";
};
return result;
});
Then you could still use
MyService.addNums("abc");
if you wanted to do so.