Exercise4 help needed

On Exercise 4, Step 3, I can’t figure out what to do. Do I make a new div? Do I replace an existing one? HALP!

I created a new div right after:

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

The new div class has ng-repeat to loop through the key (called app) in the apps array of objects. Notice that info=“app”, app is the name of the key:

    <div class="card" ng-repeat= "app in apps">
      <app-info info="app"></app-info>

You will have to change the main controller into the original data structure

I had a bunch of trouble with this problem. It was helpful to know that the end goal is to have just one “card” under the “container” in the “Main Controller” div … in the index.html document.

All of the cards will then be stored in the new scope.apps array that you create in the maincontroller.js file. This array will ultimately be the only entry underneath the function in maincontroller.js

Hopefully this info helps anyone that is looking for a hint, but not the answer!


Hi Vechau.

The term “app” doesn’t exist anywhere, was it created as a local variable inside the html tag to identify each element inside the “apps” array? Is that the logic?

What really confused me is where this “app” came from. Thank you for your time.

Yup, that’s the idea! ‘app’ can be anything you want to name it. It’s just a placeholder for each key/element in the array!

indeed, this works too

<div ng-repeat="i in apps" class="card"> 
    <app-info info="i"></app-info> 

i wonder why it is and not though

I put like there is under this comment

But an error appear, Do not reconigze the value, just show info.title, info.developer, but not the value. I cannot figure out what is wrong, someone could help me, please, i will appreciate it and thank you all

I don’t understand why this is a placeholder. How did you know to do this?