Nothing is outputing in the preview


#1

Index.html

<!doctype html>
<html>
  <head>
    <link href="https://s3.amazonaws.com/codecademy-content/projects/bootstrap.min.css" rel="stylesheet" />
    <link href='https://fonts.googleapis.com/css?family=Playfair+Display:400,400italic,700italic|Oswald' rel='stylesheet' type='text/css'>
    <link href="css/main.css" rel="stylesheet" />
    <script src="js/vendor/angular.min.js"></script>
  </head>
  <body ng-app="PizzaPlanetApp">
    <div class="header">
      <h1><span>Pizza</span><span>Planet</span></h1>
    </div>

    <div class="main" >
      <div ng-controller="MainController" class="container">
        <h1>Specials for {{ today | date }}</h1>
        
        <h2>Appetizers</h2>
        <div class="appetizers row" ng-repeat="item in appetizers">
          <div class="item col-md-9">
            <h3 class="name">{{ item.name }}</h3>
            <p class="description"> {{ item.description }}</p>
          </div>
          <div class="price col-md-3">
            <p class="price">{{ item.price | currency }}  test</p>
          </div>
        </div>

      </div>
    </div>

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

    <!-- Controllers -->
    <script src="js/controllers/MainController.js"></script>
  </body>
</html>

MainController.js

app.controller('MainController', ['$scope', function($scope) {
  $scope.today = new Date();

  $scope.appetizers = [
    {
      name: 'Caprese',
      description: 'Mozzarella, tomatoes, basil, 					balsmaic glaze.',
      price: 4.95
    },
    {
      name: 'Mozzarella Sticks',
      description: 'Served with marinara sauce.',
      price: 3.95
    },
    {
      name: Brushcetta,
      description: 'Grilled bread garlic, tomatoes, olive oil',
      Price: 4.95
    }
  ];

}]);

App.js

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

Weird thing is the "Test" part, in the actual HTML, doesn't show up in the preview either. Also, the date part should be coming through as the empty variable right? Or does that need to be in the controller scope?


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.