Skip to content

Instantly share code, notes, and snippets.

View kolexinfos's full-sized avatar
💭
Bringing the world to the cloud

Kolade Kehinde kolexinfos

💭
Bringing the world to the cloud
View GitHub Profile
@kolexinfos
kolexinfos / .ts
Created May 3, 2017 17:53
Conflict on 'this' context
import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { MessageProvider } from '../../providers/message-provider/message-provider';
class Card {
public Name:string;
constructor(name: string) {
this.Name = name;
var Verify = require('../models/verify');
var now = new Date();
now.setDate = (now.getHours() - 1)
Verify.find( //query today up to tonight
{"created_on": {"$gte": now }})
Throws an error of type mismatch, I also tested and see the that the $lt and $gte takes on Date types.
@kolexinfos
kolexinfos / app.ts
Created September 21, 2016 12:49
Synchronous Promises
I am trying to retrieve something from localstorage but would use that to decide what is served,
so until that happens execution cannot continue.
I feel I am doing something wrong as the getKey property of the LocalStorage retunrs a promise
import { Component, ViewChild } from '@angular/core';
import { ionicBootstrap, Platform, Nav, LocalStorage , Storage } from 'ionic-angular';
import { StatusBar, Splashscreen, Push } from 'ionic-native';
Please which approach is the best for modelling mongo data, I am about to create a big API for an Ionic app
Using Relationships like RDBMS
patron
{
_id: "joe",
name: "Joe Bookreader"
}
address
{
$scope.$on('$ionicView.enter', function(){
vm.errorMessage = $stateParams.errorMessage;
//if persisted User object exist then go to home page, means user has logged in before
if(PersistDataService.getObject(user) != undefined){
$state.go('home')
}
vm.doLogin = function(e) {
@kolexinfos
kolexinfos / gist:8672196
Created January 28, 2014 17:30
Gist Test
Gist Test