Meteor-Community-Packages / ground-db

GroundDB is a thin layer providing Meteor offline database and methods
https://atmospherejs.com/ground/db
MIT License
569 stars 76 forks source link

Ionic2/Angular2 support? #191

Open ksendra opened 7 years ago

ksendra commented 7 years ago

Hi, is it possible to use this package for mobile apps written with Ionic2 (which uses angular2 and typescript)?

raix commented 7 years ago

That's a goal - but it still depends on Meteor (for now)

msio commented 7 years ago

any progress on that please ?

srivastavapooja commented 7 years ago

Hi, I am trying to use ground db in my ionic2/angular2 project. I ground the collections in collections.ts which is common to both client and server. My code is

export const Messages = new MongoObservable.Collection("messages");

if(Meteor.isClient){ Ground.Collection(Messages); Ground.Collection(Meteor.users); }

In client I am getting the error "First argument to new Mongo.Collection must be a string or null at v (polyfills.js:3) at new Mongo.Collection (meteor-client.js:32177) at Object.groundCollection [as Collection]"

my ground:db version is 0.3.15 and meteor version is 1.4.4.1.

sathishTkumar commented 6 years ago

Hi @raix ,

Can we use GroundDB with Angular 2? Am trying to add by meteor add ground:db and got the below response.

meteor add ground:db

Changes to your project's package version selections:

dispatch:kernel added, version 0.0.6 dispatch:request-animation-frame added, version 0.0.1 ground:db added, version 0.3.15 ground:dictionary added, version 0.2.1 ground:localstorage added, version 0.1.9 ground:minimax added, version 1.1.3 ground:servertime added, version 0.0.3 ground:store added, version 0.1.2 ground:util added, version 0.1.17 raix:eventemitter added, version 0.1.3 raix:onetimeout added, version 1.0.4 raix:stubfence added, version 1.0.3

ground:db: Ground Meteor.Collections offline

After this, am trying to find the groundDb package in my app, i can see only the changes in .meteor\verions .meteor\local\resolver-result-cache.json .meteor\packages these file, it just added the dependencies. I hope, to work with typyscipt we need @types files (d.ts). Please help me to go forward..

@srivastavapooja , How did you import GroundDB in Angular 2? Ground.Collection(Messages); // Am facing issue here to import Ground