Edit in Plunker

    <div id="implicit" ng-controller="MyController">
      <p>Let's try the notify service, that is implicitly injected into the controller...</p>
      <input ng-init="message='test'" ng-model="message">
      <button ng-click="callNotify(message);">NOTIFY</button>
      <p>(you have to click 3 times to see an alert)</p>
    </div>

    angular.module('myServiceModuleDI', []).
      factory('notify', function($window) {
        var msgs = [];
        return function(msg) {
          msgs.push(msg);
          if (msgs.length == 3) {
            $window.alert(msgs.join("\n"));
            msgs = [];
          }
        };
      }).
      controller('MyController', function($scope, notify) {
        $scope.callNotify = function(msg) {
          notify(msg);
        };
      });

age="js">

    it('should test service', function() {
      expect(element(by.id('simple')).element(by.model('message')).getAttribute('value'))
          .toEqual('test');
    });