Nothing is rendering, can someone review?

index.html

<body ng-app="OutboxApp">
    <div class="header">
      <div class="container">
        <img src="img/logo.svg" width="140" height="150">
      </div>
    </div>

    <div class="main" ng-controller="HomeController">
      <div class="container">

        <div class="email" ng-repeat="email in emails">
          <span class="from">{{ email.from }}</span> <span class="subject">{{ email.subject }}</span><span class="date">{{ email.datetime | date.long }}</span>
        </div>

      </div>
    </div>

    <!-- Modules -->
    <script src="js/app.js"></script>

    <!-- Controllers -->
    <script src="js/controllers/HomeController.js"></script>

    <!-- Services -->
    <script src="js/services/emails.js"></script>
  </body>

js/app.js

var app = angular.module('OutboxApp', []);

js/controllers/HomeController.js

    app.controller('HomeController', ['$scope', 'emails', function($scope, emails) {
      emails.success(function(data) {
    	 $scope.emails = data;
      });

}]);

js/services/emails.js

app.factory('emails', ['$http', function($http) { 
  return $http.get('https://s3.amazonaws.com/codecademy-content/courses/ltp4/emails-api/emails.json') 
            .success(function(data) { 
              return data; 
            }) 
            .error(function(err) { 
              return err; 
            }); 
}]);

I’m having the same issue too.

i too have the same issue :frowning:

Same. I’ve had nothing rendering in other projects as well, and assumed this was because of a missing bracket somewhere. However my code is exactly the same as above and in the exercise, so I am guessing this is a bug?

Good to know I’m not the only one. I’ll notify Codecademy. - Thanks!

I’m having the same issue too.

Same here… :frowning: :frowning: :frowning:

You can add me to the list as well… :open_mouth:

Nevermind… it’s working for me now. Forgot one small piece of code. Will post the solution tonight.

I have the same problem

@jaydacoder would love to see how you fixed it.

i am having the same issue :cry:

Phew. I thought I was the only one whose projects weren’t rendering b/c I thought I left out some small detail even though I pored over every detail.

Been trying to open my code since yesterday but the CC interface crashed for me and unable to open files. Will post this when every things back to normal.

-edited by a moderator-
(full solution given, little/no explanation)


**Additional Note:** I found the positioning of the text was off a bit so I edited the .css file as well. All I did was modify .date {width: 18%} from the width it was to only 18%. Not sure if this is the best way to fix this, but it worked for me.

@jaydacoder How come your emails.js file is the same as the HomeControllers.js?

My bad, I mistakenly cut pasted the same twice. Look up again. I fixed again.

In the next courses I’ve found my mistake:
In services you should write code after return:
return $http.get(‘https://s3.amazonaws.com/codecademy-content/courses/ltp4/emails-api/emails.json’)

NOT in the next line (don’t work):
return
$http.get(‘https://s3.amazonaws.com/codecademy-content/courses/ltp4/emails-api/emails.json’)

3 Likes

I was having the same problem. My mistake was a typo:

ng-app=“OutBoxApp”

instead of:

ng-app=“OutboxApp”

Thanks for the reference code! My mistake was that I forgot to add the emails indicated in the attachment below. Hope this helps someone.