Custom service in angularjs with example