Question

I have the following code which shows whatever gets published to Firebase.

var app = angular.module("myapp", ["firebase"]);
function MyController($scope, $firebase) {
    var ref = new Firebase(".....");
    $scope.messages = $firebase(ref.endAt().limit(100));
}

<div ng-app="myapp">
        <div id="links" ng-controller="MyController">                
            <a ng-repeat="msg in messages" href="{{msg.highResUrl}}" data-gallery>
                <img src="{{msg.imgUrl}}" style="width: 140px"/>
                 <!--This repeat isn't working-->
                 <ul>
                      <li ng-repeat="tag in msg.tags">{{tag}}</li>                     
                 </ul>

            </a>
        </div>
    </div>

The data looks like this:

{
 "highResUrl" : "...",
 "Source" : "....",
 "title" : "Img",
 "tags" : [ "Tag1", "Tag2", "Tag3", "Tag4" ],
 "imgUrl" : "..."
}

All the other data works, except the inner ng-repeat on tags. Any idea?

Thanks

Was it helpful?

Solution

Have a look at this plunkr. It seems it works with some fixture data.

Test data:

$scope.messages = [{
                   "highResUrl" : "",
                   "Source" : "",
                   "title" : "Img",
                   "tags" : [ "Tag1", "Tag2", "Tag3", "Tag4" ],
                   "imgUrl" : ""
                  },
                  {
                   "highResUrl" : "",
                   "Source" : "",
                   "title" : "Img",
                   "tags" : [ "Tag1", "Tag2", "Tag3", "Tag4" ],
                   "imgUrl" : "http://devgirl.org/wp-content/uploads/2013/03/angular-logo.jpeg"
                  },
                  {
                   "highResUrl" : "",
                   "Source" : "",
                   "title" : "Img",
                   "tags" : [ "Tag1", "Tag2", "Tag3", "Tag4" ],
                   "imgUrl" : "http://devgirl.org/wp-content/uploads/2013/03/angular-logo.jpeg"
                  },
                  {
                   "highResUrl" : "",
                   "Source" : "",
                   "title" : "Img",
                   "tags" : [ "Tag1", "Tag2", "Tag3", "Tag4" ],
                   "imgUrl" : "http://devgirl.org/wp-content/uploads/2013/03/angular-logo.jpeg"
                  }];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top