title: writing functions in angularjs services
body: <p>i want to write a function inside a angularjs service and i want to reuse it in all my </p>
  
  <p>controllers. </p>
  
  <pre><code>var mod= angular.module('myapp', ['eventFilters', 'highlight', 'event', 'dayfilter', 'Services']).
  config(['$routeProvider', function($routeProvider) {
  $routeProvider.
        when('/', {templateUrl: 'template.html',   controller: Ctrl}).
        when('/temp', {templateUrl: 'temp.html',   controller: tempCtrl}).
        otherwise({redirectTo: '/invalid'});
  }]);
  mod.service ('sharedService', function() {
  function daysInMonth(month,year) {
      return new Date(year, month+1,0).getDate();
  }
  });
  </code></pre>
  
  <p>i want to use the daysInMonth function in any of my controller.
  is it possible? if so could anyone explain me briefly with some examples in fiddle.</p>
  
  <p>Thanks in advance</p>