Queries with join in Meteor Angular

Hello I have 2 collections:

  • Authors
  • Posts
    Every post has authorId. I want to fetch 10 posts with his author (not authorId, real author object)
    I don’t care about real-time.
    I know publish composite, but i read that not working in meteor angular.
    Please provide comment with example, it will help mw to understand.

One more question, how should I know in angular when the object are fetched from the server?
I didn’t see any example for promises.

Bump. And my meaning is to use 1 HTTP request for post and author. Not 2 requests, 1 for post and 1 for author.
Thanks…

Bump… please help…

Hello, why are you saying that publish-composite is not working on Angular Meteor?
It’s working exactly like any other Blaze/React Meteor application.
Can you please provide an example of your code using the new Angular Meteor 1.3 API?

Hello
Please help i have a probleme with publish composites with angular !!

// Server
Meteor.publishComposite(‘annonces’, {
find: function() {
return Annonces.find({}, {sort: {published: 1}});
},
children: [
{
find: function(annonce) {
return Comments.find({annonceId: annonce._id}, {sort: {published: 1}});
}
}
]
});

directive :
annonces: () => {
return Annonces.find({});

            },
            commentsAnnonce: (annonce) => {
                return Comments.find({annonceId: annonce._id}, {sort: {published: 1}});
            },

Template:
ng-init=“comments=annoncesList.commentsAnnonce(annonce)”

Error :
Error: annonce is undefined
commentsAnnonce@http://localhost:3000/app/client/annonces/annonces-list/annonces-list.component.js?23dc10204b81f6aa97377cac091e2e81dd582ab0:43:29
_setFnHelper/<@http://localhost:3000/packages/angular-meteor-data.js?80493f5d8e093ee6361da8afa7e686567aadba97:1754:23
this._bindFn/<@http://localhost:3000/packages/angular-meteor-data.js?80493f5d8e093ee6361da8afa7e686567aadba97:1504:20
this._bindFn/<@http://localhost:3000/packages/angular-meteor-data.js?80493f5d8e093ee6361da8afa7e686567aadba97:1504:20
Tracker.Computation.prototype._compute@http://localhost:3000/packages/tracker.js?7776276660c988c38fed448d8262b925dffb5bc3:349:5
Tracker.Computation@http://localhost:3000/packages/tracker.js?7776276660c988c38fed448d8262b925dffb5bc3:237:5
Tracker.autorun@http://localhost:3000/packages/tracker.js?7776276660c988c38fed448d8262b925dffb5bc3:588:11
this.autorun@http://localhost:3000/packages/angular-meteor-data.js?80493f5d8e093ee6361da8afa7e686567aadba97:1548:21
autorun@http://localhost:3000/packages/angular-meteor-data.js?80493f5d8e093ee6361da8afa7e686567aadba97:1706:25
_setFnHelper@http://localhost:3000/packages/angular-meteor-data.js?80493f5d8e093ee6361da8afa7e686567aadba97:1753:9
helpers/<@http://localhost:3000/packages/angular-meteor-data.js?80493f5d8e093ee6361da8afa7e686567aadba97:1695:32
_.forEach@http://localhost:3000/packages/underscore.js?46eaedbdeb6e71c82af1b16f51c7da4127d6f285:157:13
helpers@http://localhost:3000/packages/angular-meteor-data.js?80493f5d8e093ee6361da8afa7e686567aadba97:1690:9
Reactive[method]@http://localhost:3000/packages/angular-meteor-data.js?80493f5d8e093ee6361da8afa7e686567aadba97:1919:15
controller@http://localhost:3000/app/client/annonces/annonces-list/annonces-list.component.js?23dc10204b81f6aa97377cac091e2e81dd582ab0:28:1
invoke@http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:4546:14
$ControllerProvider/this.$get</</instantiate<@http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:9205:24
nodeLinkFn@http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:8322:34
compileTemplateUrl/<@http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:8595:1
processQueue@http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:14815:28
scheduleProcessQueue/<@http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:14831:27
$RootScopeProvider/this.$get</Scope.prototype.$eval@http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:16075:16
$RootScopeProvider/this.$get</Scope.prototype.$digest@http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:15893:15
$RootScopeProvider/this.$get</Scope.prototype.$apply@http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:16183:13
bootstrapApply@http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:1702:9
invoke@http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:4546:14
bootstrap/doBootstrap@http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:1700:1
bootstrap@http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:1720:1
angularInit@http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:1614:5
@http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:29036:5
jQuery.Callbacks/fire@http://localhost:3000/packages/jquery.js?1015953f785c9b76503e2ecb391507dce965f357:3169:10
jQuery.Callbacks/self.fireWith@http://localhost:3000/packages/jquery.js?1015953f785c9b76503e2ecb391507dce965f357:3281:7
.ready@http://localhost:3000/packages/jquery.js?1015953f785c9b76503e2ecb391507dce965f357:3493:1
completed@http://localhost:3000/packages/jquery.js?1015953f785c9b76503e2ecb391507dce965f357:3524:3