0

I have angularjs setup with routes and I am having some problems with ng-repeat. Here is the code I have in my view

<div class="jumbotron text-center">
    <h1>Home Page</h1>

    <p>{{ message }}</p>
</div>
<div>
    {{allApps}}
</div>
<div ng-repeat="app in allApps">
    <p>Here {{ app }}</p>
</div>

Everything above the ng-repeat is showing. The allApps above is showing my json object. Maybe it could be how I am building my json. Here is what the json looks like

[{"id":"1","app_name":"Disconnect Search (Beta)","app_url":"https:\/\/play.google.com\/store\/apps\/details?id=me.disconnect.search","app_provider":"D2d","app_price":"Free","app_image_url":"https:\/\/lh5.ggpht.com\/j4Wagvv21vGD5F3oU_cl4LZWJnBLVR4ElKFsw9xuNaF0P96VFvTJY3v_nXZNcBkEqQ=w300-rw","app_show_number":"170"},{"id":"2","app_name":"Nmb3rs - numbers in words","app_url":"https:\/\/play.google.com\/store\/apps\/details?id=com.funnygerman.nmbrs","app_provider":"EricA","app_price":"Free","app_image_url":"https:\/\/lh4.ggpht.com\/uMN0q1f2BsHVt4p0qHlhsrcFCgF201VaTRSJOiDf_mxzx3eUzGhBnkB0wWzzLrlszNUR=w300-rw","app_show_number":"170"},{"id":"3","app_name":"Mountains Now Free Wallpaper","app_url":"https:\/\/play.google.com\/store\/apps\/details?id=com.intcast.livecinemagraph.gnrockymountains","app_provider":"EricA","app_price":"Free","app_image_url":"https:\/\/lh6.ggpht.com\/cXpCAtTuNBeFZIy3ntMOERI8WCnQ3N8i3YhE_KI8TdH4AwSpJYxzDRi-204MDUwGxBkm=w300-rw","app_show_number":"169"}]

I am building this json using json_encode from a mysql statement. Thanks for any help.

1
  • You may want <p>Here {{ app.app_name }}</p> or similar. Commented Oct 7, 2014 at 21:54

1 Answer 1

1

allApps is probably a string instead of an object. Throw a $scope.allApps = angular.fromJson($scope.allApps); in there somewhere.

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

1 Comment

This worked. Thanks. I will add answer when stack allows me to

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.