向 angular-meteor 应用程序请求数据

Request data to an angular-meteor application

我目前正在开发一个应用程序,该应用程序在 mongo 个电视频道中有一个集合。

该应用程序发展得非常好,但我被要求创建一个具有不同域的外部应用程序或页面,只是为了显示更新频道列表(频道之前和当前频道以及新版本等)

我所做的是创建一个没有服务器的简单 angular 应用程序,只是纯粹的 angular,我想知道如何发出 http 请求来获取 list/collection 具有 list/collection 个频道的主应用程序。

这是频道方案:

meteor:PRIMARY> db.channels.find().pretty()
{
    "_id" : "2WzykFxP3LpNvh4hq",
    "logo" : "images/alineacion/ultimate/tbn.svg",
    "before" : 104,
    "number" : 105,
    "category" : [
        "Ultimate"
    ],
    "edit" : false,
    "name" : "tbn"
}

问题

如何发出 http 请求以从不同的 angular 应用程序获取 list/collection 频道到 angular-meteor 应用程序,以便我能够列出频道?

之前有关于此的问题,如果您对通过 http 调用数据访问的想法有所了解,我建议您复习一下。我从这里开始:How to expose a RESTful Web Service using Meteor; this had a link to a github which linked to another github: https://github.com/xcv58/meteor-collectionapi

Atmosphere 也有用于简化在您的流星应用程序上创建 REST API 的程序包:例如 https://atmospherejs.com/simple/rest。在我看来,Atmosphere 包比其他来源更容易集成。

最后,我建议为您的 angular 应用程序查看 DDP - 这允许您的应用程序与您已经通过公开的集合和方法构建的 Meteor 应用程序进行交互。

https://github.com/afuggini/angular-ddp seems to address your specific (angular) case; I have used https://www.npmjs.com/package/ddp-client 在 react-native 应用程序中。