0

Hi there i'm trying prnting a simple json object to a div:

<div ng-repeat=" i in config.app_genres.genres">
    {{  i }}
</div>

and

 config.app_genres = {
 "genres":["asd","ips"]
}

what's wrong with this?

Also how can i log config.app_genres in a view?

1
  • It wud be better if u post full code including html and javascript and most important thing is to check console error in browser, if any. Commented Jan 22, 2014 at 11:54

1 Answer 1

1

Have a look at this plunk.

As for logging config.app_genres in the view, not sure what you mean, care to elaborate?

Sign up to request clarification or add additional context in comments.

5 Comments

so need i strictly a controller ? can't i iterate on a global rootScope object ?
of course you need a controller, how can you access any scope without a controller? even if you want to use $rootScope you need a controller for that.
just cause i'm setting $rootScope params to have them ready where needed
there is no way to print out data without a controller in a loop?? :O
controllers are what glue your view to some data, i can't imagine how you'd tell your view what to print without controllers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.