Open niketaB opened 8 years ago
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.
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...
@LucNaterop how did you installed GroundDB in ionic
I need some guidelines to integrate ground DB with Angular-ionic type of application. What exactly, i am doing is,