Hello AngularJS I/ AngularJS II


#1

I don't know if I did it wrong, it allowed me to go to the next one though, but on the localhost browser section it doesn't show the contents that are saved under the $scope.title. The<h1>{{ title }}</h1> would print out {{ title }}, is that suppose to happen?

the same goes when I do the section in Hello AngularJS II for the $scope.promo. the <h2>{{ promo }}</h2> doesn't show the contents that are placed under the $scope.promo and just shows {{ promo }}. I copied and paste what they said to put so yeah...

Is this suppose to happen? :confused:


#2

If its $scope.something.promo

its suppose to be

{{something.promo}}

Can you give the js code?


#3

In app.js
var app = angular.module("myApp", []);

in MainController.js
app.controller('MainController', ['$scope', function($scope) {
$scope.title = 'Top Sellers in Books';
$scope.promo = 'Only the best';
}]);

idk why it didnt indent :confused:


#4

Hmm :confused: .... the Js is all fine.. Can you give me the HTML Code?


#5

Any news? I have the same problem :frowning: This is my HTML:


#6

Seems to be working fine now that I've moved on to the next exercise. I think there was a problem with the index.html, it appeared to be empty at first.


#7

<!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=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 class="col-md-6">
          <div class="thumbnail">
            <img src="img/the-book-of-trees.jpg">
            <p class="title"> </p>
            <p class="price"> </p>
            <p class="date"> </p>
          </div>
        </div>

      </div>
    </div>

    <div class="footer">
      <div class="container">
        <h2>Available for iPhone and Android.</h2>
        <img src="https://s3.amazonaws.com/codecademy-content/projects/shutterbugg/app-store.png" width="120px" />
        <img src="https://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>

#8

so do you mean it shows what you typed in the $scope.title instead of {{ title }}??


#9

Yes it will show what you typed out under the scope so what you should see is:

Top Sellers in Books

Only the best

Have a look at the lesson's explanation before the instructions, once you read it you will understand much better


#10

but some reason it doesn't show what i typed under the scope for me :confused:


#11

You clicked run? Tried refresh page?


#12

Yes, it shows whatever I type. I really don't know why it won't work for you, sorry. Try to move on and then come back to it.


#13

Yes, I did multiple times for all suggestions. I redid the code and all but it doesn't work. I don't know what else to do honestly.


#14

sigh i dont know. I really want to learn and I hope im doing it right. if i just move on like that and never got it to work, i wouldn't have learnt anything


#15

I don't know what to say... Umm try reset the lesson ? get help - reset


#16

i did that :confused: i guess it is my account only then