Um aluno do Be MEAN postou essa modelagem relacional a qual ele estava com dificuldades para passar para o MongoDB, então vou ensinar aqui como faz
Vamos inicialmente separar pelas COLEÇÕES que achamos que devemos ter:
- Usuario;
- Escola;
import {Injectable} from "@angular/core"; | |
import {Platform} from "ionic-angular"; | |
const DB_NAME: string = '__mydbname'; | |
const win: any = window; | |
@Injectable() | |
export class Sql { | |
private _dbPromise: Promise<any>; |
import {Sql} from "../providers/Sql"; | |
export class ExamplePage { | |
constructor(private sql: Sql) { | |
//sql.query(...); | |
//... | |
} | |
} |
Learn how you can create your own Twitter bot using Node.js and the new Twitter API. The bot will auto retweet in response to tweets with some particular hashtags. (https://goo.gl/4whEIt)
Here are the tools we’ll be using to create the bot —
Then in your controller
, inject $polling
and start polling like this.
General use
$polling.startPolling({name_of_this_polling}, {url_to_fetch_data_from}, {time_in_milli_seconds}, {callback});
Example,
$polling.startPolling('fetchNotifications', 'http://localserver.local/fetch/notifications', 10000, $scope.processData);
// This is from my comment here: http://wolfram.kriesing.de/blog/index.php/2008/javascript-remove-element-from-array/comment-page-2#comment-466561 | |
/* | |
* How to delete items from an Array in JavaScript, an exhaustive guide | |
*/ | |
// DON'T use the delete operator, it leaves a hole in the array: | |
var arr = [4, 5, 6]; | |
delete arr[1]; // arr now: [4, undefined, 6] |