title: AngularJS: Pass textbox value to services
body: <p>I am new in angularJS. Currently working on services. I tried to pass text-box value to services. I don't know how to pass. I code but it's not working.</p>
  
  <pre><code>app.service("wishService", function ($timeout) {
      this.wishHim = function (_wishMessage) {
          $timeout(function () {
              alert('Hi ,' + _wishMessage);
          }, 2000);
      }
  });
  
  app.controller('wishCtrl', ['$scope', function ($scope, wishService) {    
      $scope.Message = "";
      $scope.SendMessage = function (wishMessage) {
          wishService.wishHim(wishMessage);
      };
  }]);
  
  
  &lt;div ng-controller="wishCtrl"&gt;
          Wish Message: &lt;input type="text" ng-model="wishMessage" /&gt;
          &lt;input type="button" value="Send Message" ng-click="SendMessage(wishMessage)" /&gt;&lt;br /&gt;
          Your Message : {{Message}}
  &lt;/div&gt;
  </code></pre>
  
  <p><strong><a href="https://plnkr.co/edit/MVKnXmXTFY4fTvZigPR1?p=preview" rel="nofollow">DEMO</a></strong></p>