title: Angular js :-> angular throws unknown provider error while accessing resolve proprerty
body: <p>when i remove ng-controller from view ,resolve property works perfectly fine but when i put ng-controller in template,it throws unknown provider.can any body help me out why this is happening??</p>
  
  <pre><code>app.config(['$routeProvider',function($routeProvider) {
          $routeProvider.
              when('/', {
                  templateUrl: 'page/login.html',
                  controller: 'loginController',
                  resolve: {
                      message: function(demoService){
                          return demoService.getResolveContent();
                      },
                      greeting: function(demoFactory){
                          return demoFactory.getGreeting();
                      }
                  }
  
              }).
              when('/profile', {
                  templateUrl: 'page/profile.html',
                  controller: 'profileController'
              })
              .otherwise({
                  redirectTo: '/'
              });
      }]);
  </code></pre>
  
  <blockquote>
    <p>function loginController($scope,$location,message,greeting){</p>
  
  <pre><code>    $scope.tempfactory = greeting;
  
  }
  </code></pre>
  </blockquote>
  
  <pre><code>&lt;div style="color: white;width: 100%;height: 100%;background-color: lightgray" ng-controller="loginController"&gt;
  
      &lt;p&gt;{{tempfactory}}&lt;/p&gt;
      &lt;input type="text" ng-model="inputBoxValue"&gt;
      &lt;button style="width: 100px;height: 100px" ng-click="profilePage()"&gt;&lt;/button&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>If i replace above html with this:</p>
  
  <pre><code>&lt;div style="color: white;width: 100%;height: 100%;background-color: lightgray" &gt;
  
      &lt;p&gt;{{tempfactory}}&lt;/p&gt;
      &lt;input type="text" ng-model="inputBoxValue"&gt;
      &lt;button style="width: 100px;height: 100px" ng-click="profilePage()"&gt;&lt;/button&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>It worked perfectly fine.can any body tell me the reason of this.</p>