Create a service in ionic


#1

I am creating a service in ionic using

    angular.factory('abc', function($http) { 
	return { 
		abcDEF: function() {
		return $http.get("http://localhost:8001/abc");
        }
   } });

and my controller is

app.controller('abc',function($scope,$http) {
         $scope.counter = 0;
         $scope.count = function (inc) {
         $scope.counter += inc;
         };
      });

and my node.js code is

app.get('/abc', function(req,res){
    res.send("hello");  
	
   }); 

where i am going wrong ???
and i am unable to get the localhost:3000/abc


#2

Just Change the service and controller Name


#3

rest the code is correct or not


#4

I dont quite understand what your are trying to do but, the one thing I can see is that if your server is running on port 3000 you should do return $http.get("http://localhost:3000/abc"); and no 8001. See if that helps.