0

I am currently have trouble displaying my array using the "Controller as" syntax if I pass the $scope in to my controller it works fine but using the "Controller as" syntax and this. My array does not appear on the page I'm just wondering if I am doing something wrong?

Here is the JSBin

http://jsbin.com/qufevalenoda/1/edit?html,js,output

2
  • 1
    Should be <p ng-repeat="post in main.posts">{{ post }}</p> Commented Oct 3, 2014 at 20:48
  • Ahhh thanks you!!! Anthony! Stupid little mistakes Commented Oct 3, 2014 at 20:53

1 Answer 1

0

http://jsbin.com/qufevalenoda/3/edit

<div ng-controller="MainCtrl as main">
    {{ main.title }} <br> <br>
    {{ main.posts }}
    <p ng-repeat="post in main.posts">
        {{ post }}
    </p>
</div>
Sign up to request clarification or add additional context in comments.

Comments

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.