我有两个模型是相关的通过hasAndBelongsToMany发布通过3个中间模型。例如:Artist通过第三中间模型TracklistArtist与Tracklist模型相关。Tracklist模型有belongsTo和Song模型。
我想拿一首和那个艺术家有关的歌。
Artist.tracklists({
id: $stateParams.artistId,
filter: {
include: [{relation:"song",scope:{limit:2}}]
}
}).$promise.then(function (data) {
$scope.items = data;
});我指的是从这个链接过滤包含条件的链接。IncludeFilter
问题是--
发布于 2015-08-20 20:03:30
要使用极限特性,您可以按照文档的指示编写如下所示的内容
include: {
relation: 'song',
scope: {
limit:5
}
}https://stackoverflow.com/questions/32073605
复制相似问题