1

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

2
  • 1
    messages is an array ? Can you try msg in messages track by $index ? Commented Feb 20, 2014 at 8:50
  • So... what doesn't work? What does the inner ng-repeat do? Any errors? Commented Feb 20, 2014 at 15:32

1 Answer 1

1

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"
                  }];
Sign up to request clarification or add additional context in comments.

1 Comment

Works fine for me with the provided data put into Firebase - plnkr.co/edit/ZunRqZLrOuKxaiWa3OUo?p=preview

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.