Services I, what's wrong with the code


The code won't run and I can't figure out why?

app.factory('forecast', ['$http', function($http) {
.success(function(data) {
return data;
.error(function(err) {
return err;


I have this same problem


If the quote below is displaying the code as you wrote it, you need a space between return and $http.

So instead of being written like so:
write it like this:
return $http.get('')
Since they are showing as being on separate lines in your example, add a space after the return.


instead of typing it, just copy and paste the code. it will work


It's very strange lesson. It's said that we are using services, but in fact we are using factories.
In the code to this lesson no one word "service". So it has to be called factories)