title: Same angular service injection into factory and Controller
body: <p>Currently for loading a minimum of 100 customer booking records, We have used Angular factory as InitializationFactory for having the data in hand before the page loads and this factory is registered in Routes. This factory makes use of <strong>customerService</strong> to talk to relevant API. This whole request takes round about 5-7seconds to complete. We have the requirement of applying filters on top of the fetched data.</p>
  
  <p>Considering page performance in mind, We now want to fetch only 10 records with dynamic filters applied over it. Next set of records would be retrieved based on a click event. Now, in order to do so, I need to inject <strong>customerService</strong> into CustomerController as well.
  So, by design, is it a good approach to inject customerService into factory and then into controller for further data retrieval?</p>
  
  <p>Code Snippet:</p>
  
  <ol>
  <li><p>Route.js</p>
  
  <pre><code> .state("app.customer.dashboard",
      {
          parent: "parent",
          controller: "CustomerBookingController",
  
          resolve: {
              customerBookingListModel: [
                      "CustomerInitializationFactory",
                      function (customerInitializationFactory) {
                          return customerInitializationFactory.initializeCustomerBookingResult();
                      }
              ]
          }
  </code></pre></li>
  <li><p>CustomerInitializationFactory.js</p>
  
  <pre><code>function CustomerInitializationFactory(customerService, $translate, bookingConstants) {
  return {
      initializeCustomerAccountResult: function() {
      var params = "xyz";
      var promise = customerService.getCustomerBookings(params)
              .then(function(bookingResponse) {
                  var customerBookings = constructCustomerBookings(bookingResponse);
                  return customerBookings;
              });
          return promise;
  } };
  </code></pre></li>
  <li><p>CustomerBookingController.js</p>
  
  <pre><code>function CustomerBookingController(customerBookingListModel,customerService???) {
  $scope.LoadMoreBookings = function(params) {
      var bookings = customerService.getCustomerBookings(params);
  };
  </code></pre></li>
  </ol>