Nothing is rendering, can someone review?


#1

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; 
            }); 
}]);

#2

I'm having the same issue too.


#3

i too have the same issue :frowning:


#4

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?


#5

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


#6

I'm having the same issue too.


#7

Same here... :frowning: :frowning: :frowning:


#8

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


#9

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


#10

I have the same problem


#11

@jaydacoder would love to see how you fixed it.


#12

i am having the same issue :cry:


#13

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.


#14

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.


#15

-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.

#16

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


#17

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


#18

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')


#19

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

ng-app="OutBoxApp"

instead of:

ng-app="OutboxApp"


#20

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