Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Ground DB in angular-meteor #149

Open
niketaB opened this issue Feb 3, 2016 · 3 comments
Open

How to use Ground DB in angular-meteor #149

niketaB opened this issue Feb 3, 2016 · 3 comments

Comments

@niketaB
Copy link

niketaB commented Feb 3, 2016

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.
@lucnat
Copy link

lucnat commented Feb 9, 2016

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.

@zaik18
Copy link

zaik18 commented Feb 23, 2016

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...

@koradeharshad
Copy link

@LucNaterop how did you installed GroundDB in ionic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants