2

I am Angular 4 developer. Want to include RocketChat Engine developed in MeteorJS. By research I got to know that it will need DDP(Protocol) to connect Angular4 with Meteor.

I am unable to find any DDP package which allows me to integrate with Angular4 TypeScript.

Can you please help me out in this?

Urigo
  • 3,175
  • 21
  • 27

2 Answers2

3

You could use a plain DDP packages. Probably the most popular one is mondora's asteroid.

But you could also use Meteor's own packages.

The advantages are that they are better maintained and also they include not only DDP but also a local cache implementations and Mongo API on the client.

You don't need to use the Meteor build system for that, here is a blog post about meteor-client-bundler.

Once you have that, the best way to integrate Meteor's DDP with Angular is through Meteor-RxjS.

Here is a simple example using the AngularCLI and a tutorial that uses Ionic. - and here you can check out a small example with the Angular CLI.

As a side note, it looks like the future protocol you would want to use is GraphQL and GraphQL-Subscriptions for real time.

We've recently made a PR for RocketChat to support GraphQL - https://github.com/RocketChat/Rocket.Chat/pull/8158 I hope they will merge that soon.

In this PR you can check out an AngularCLI with PWA that uses RocketChat's new GraphQL API - https://github.com/RocketChat/Rocket.Chat.PWA/pull/32

Urigo
  • 3,175
  • 21
  • 27
  • I have installed meteor-client-bundler and meteor-rxjs on the client side and trying to use MongoObservable to call the collections but getting namespace error for meteor and mongo. – Habib Dec 28 '18 at 12:16
  • Can you create a reproduction and post it as an issue on the repo? – Urigo Dec 28 '18 at 14:44
0

There are a few ddp-client packages. Among them is https://github.com/oortcloud/node-ddp-client

Basically they allow you to communicate with a Meteor server over DDP.

I'll let you look through them and decide which suits you

Mikkel
  • 7,693
  • 3
  • 17
  • 31
  • Yes. I have found this package. But its in Pure Node. I am using **Angular 4** with **TypeScript**. So I need a package which allows me to write code in **TypeScript** and connect to Meteor Server. I have found this package with TypeScript: https://www.npmjs.com/package/rxjs-ddp-client which is giving me some errors. Can you help me out to find package? – Mayur Champaneria Oct 26 '17 at 04:41