ground-db icon indicating copy to clipboard operation
ground-db copied to clipboard

How to use Ground DB in angular-meteor

Open niketaB opened this issue 8 years ago • 3 comments

I need some guidelines to integrate ground DB with Angular-ionic type of application. What exactly, i am doing is,

  1. I have ionic-angular application
  2. I am using angular-meteor package in to Ionic application, to get meteor packages and functionality. Now I want to use GroundDB, which is meteor package in to my App. Is the ground db package available with angular-meteor package ? Please let us know how to integrate this and use it.

niketaB avatar Feb 03 '16 06:02 niketaB

Hi! I am using ground:db with in an angular ionic app as well, and it works perfectly. Where exactly are you having problems? There is nothing special to say about using ground:db with angular/ionic. Just do everything as usual, that is, define your grounded collections in the lib folder.

lucnat avatar Feb 09 '16 12:02 lucnat

I need help...

Messages = new Mongo.Collection('messages');

Messages.attachSchema( new SimpleSchema({ text : { type: String },
user_type : { type : String}, chat_session_id : { type : String }, type : { type : String }, lat : { type : String , optional : true}, lng : { type : String , optional : true}, date : { type : String }, is_sent : { type : Boolean , optional : true}, user_id : { type : String }, created_at : { type: Date, autoValue: function() { if (this.isInsert) { return new Date(); } else if (this.isUpsert) { return {$setOnInsert: new Date()}; } else { this.unset(); // Prevent user from supplying their own value } } }, updated_at : { type: Date, autoValue: function() { if (this.isUpdate) { return new Date(); } }, denyInsert: true, optional: true } }) );

if ( Meteor.isClient ) { Ground.methodResume([ 'message.add', 'message.update', 'message.remove' ]); }

if (Meteor.isCordova) { Ground.Collection(Messages); }

I am only getting messages added in offline mode. I want to get all messages wehther added offline or online when page opens.

I am subscribing like this... this.subscribe('Messages'); this.helpers({ messages: () => { return Messages.find({ chat_session_id : vm.chat_data.chat_session_id }).fetch(); } });

please help me out

I am using angular meteor ionic...

zaik18 avatar Feb 23 '16 15:02 zaik18

@LucNaterop how did you installed GroundDB in ionic

koradeharshad avatar Nov 10 '16 06:11 koradeharshad