I am facing an error in ng-Click-I in Angular JS course


#1

//HTML CODE//

<!doctype html>
<html>
  <head>
      <link href="http://s3.amazonaws.com/codecademy-content/projects/bootstrap.min.css" rel="stylesheet" />
    <link href='http://fonts.googleapis.com/css?family=Roboto:500,300,700,400' rel='stylesheet' type='text/css'>
    <link href="css/main.css" rel="stylesheet" />

    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js"></script>
  </head>
  <body ng-app="myApp">
    <div class="header">
      <div class="container">
        <h1>Book End</h1>
      </div>
    </div>

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

        <h1>{{ title }}</h1>
        <h2>{{ promo }}</h2>

        <div ng-repeat="product in products" class="col-md-6"> 
  				<div class="thumbnail"> 
    				<img src="img/the-book-of-trees.jpg"> 
    				<p class="title">{{ product.name }}</p> 
				    <p class="price">{{ product.price | currency }}</p> 
				    <p class="date">{{ product.pubdate | date }}</p> 
  				</div> 
				</div>

      </div>
    </div>

    <div class="footer">
      <div class="container">
        <h2>Available for iPhone and Android.</h2>
        <img src="http://s3.amazonaws.com/codecademy-content/projects/shutterbugg/app-store.png" width="120px" />
        <img src="http://s3.amazonaws.com/codecademy-content/projects/shutterbugg/google-play.png" width="110px" />
      </div>
    </div>


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

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

///Main Controller data

app.controller('MainController', ['$scope', function($scope) { 
  $scope.title = 'This Month\'s Bestsellers'; 
  $scope.promo = 'The most popular books this month.';
  $scope.products = [
  	

{ 
    	name: 'The Book of Trees', 
    	price: 19, 
      likes: 0,
    	pubdate: new Date('2014', '03', '08'), 
    	cover: 'img/the-book-of-trees.jpg' 
  	},


  	{ 
    	name: 'Program or be Programmed', 
    	price: 8, 
      likes: 0,
    	pubdate: new Date('2013', '08', '01'), 
    	cover: 'img/program-or-be-programmed.jpg' 
  	},
    {
      name: '5 point someone',
    	price: 10,
    	likes: 0,
    	pubdate: new Date('2009','08','01'),
     	cover: 'img/program-or-be-programmed.jpg' 
    },
    {
      name: 'One Night at Callcenter',
    	price: 10,
    	likes: 0,
    	pubdate: new Date('2009','08','01'),
     	cover: 'img/program-or-be-programmed.jpg' 
    }
  ]
}]);

#2

so what is your error?


#3

Its showing an error as Oops something went wrong.There might be an error in syntax. But before this exercise everything was fine. I dont know why it is showing this error. I have only added the likes element to each book.


#4

you appear to be missing a semicolon after the ] on the next to last line, not sure if that would cause the error


#5

if thats not whats causing it, I would suggest just reseting the exercise and re-adding the likes properties just in case there’s something you accidentally changed


#6

Thanks ninjamoose91 It asked for get code when i clicked it it displayed the sme code but i was through


#7

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