0
    <ul class="dropdown-menu" ng-repeat="_Routevalue in _ViewItems">
        <!--<li><a>Hello</a></li>-->
        <!--<li><a>Hello</a></li>-->
        <li>{{_Routevalue.productName}}</li>
    </ul>

Here's the hardcoded values displayed properly, but when I use the ng-repeat it's only showing the last one.

1 Answer 1

2

You should add ng-repeat to the <li>, not to the <ul>

<ul class="dropdown-menu">
    <li ng-repeat="_Routevalue in _ViewItems">{{_Routevalue.productName}}</li>
</ul>
Sign up to request clarification or add additional context in comments.

5 Comments

While this is 100% correct, i'm not sure if this is the issue. This would still show all values, just each one within its own <ul>. Unless there is a CSS style that is doing a float / position on them and they're really just stacking.
Ok, so what is the value of _ViewItems? is it an Array or an Object?
@MichaelLynch <li style="padding: 5px;" ng-repeat="_Routevalue in _ViewItems"> <a class="_Routevalue.menuIcon"> {{_Routevalue.productName}}</a> </li> here class="_Routevalue.menuIcon" is not binding menu icons
I mean, the value of _ViewItems in the controller, you can try with console.log($scope._ViewItems)
@susSam Did the answer above solve your problem (as you're now asking about a class issue?). To solve your class problem, instead of class="_Routevalue.menuIcon" use ng-class="_Routevalue.menuIcon"

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.