title: $injector:undef Provider 'dataService' must return a value from $get factory method
body: <p>I am trying to learn AngularJS. Whdile I was following the instructor, I wrote the same code as he did. But I am getting a <code>[$injector:undef] Provider 'dataService' must return a value from $get factory method</code> error. When I searched for this error in web, it is told that I must return a function or an object. I guess I am doing it. My factory declaration is below:</p>
  
  <pre><code>module.factory("dataService", ['$http', '$q', function ($http, $q) {
      var _topics = [];
      var _getTopics = function () {
          var deferred = $q.defer();
          $http.get("/api/v1/topics?includeReplies=true")
              .then(function (result) {
                  //success
                  angular.copy(result.data, _topics);
                  deferred.resolve();
              },
              function () {
                  //error         
                  deferred.reject();
              });
          return deferred.promise;
      };
      return
      {
          topics: _topics;
          getTopics: _getTopics;
      };
  }]);
  </code></pre>
  
  <p>Any helps are appreciated...</p>