Skip to content

Update and fix the examples #4

@jukkakoskinen

Description

@jukkakoskinen

Some of the usage examples seem to be broken, for example the query function...

$scope.posts = Post.query({
    page: 1
});

...doesn't return a collection like the example suggests. Tested on Angular 1.0.7 & 1.1.5 with the following code:

app.factory('User', function (firebaseResource) {
    var User = firebaseResource({
        path: 'users',
        hasMany: ['Post']
    });

    return User;
});

app.factory('Post', function (firebaseResource) {
    var Post = firebaseResource({
        path: 'posts',
        belongsTo: true,
        perPage: 10
    });

    return Post;
});

app.controller('PostsCtrl', function ($scope, Post, User) {
    $scope.user = User.query()[0];
    $scope.posts = $scope.user.posts().query({
        page: 1
    });
});

Sorry I couldn't get a Fiddle up to demonstrate the problem...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions