Skip to content

Instantly share code, notes, and snippets.

(function () {
var root = $(document.getElementsByTagName('body'));
var watchers = [];
var f = function (element) {
if (element.data().hasOwnProperty('$scope')) {
angular.forEach(element.data().$scope.$$watchers, function (watcher) {
watchers.push(watcher);
});
}
@ilgianfra
ilgianfra / sqlite.service.js
Last active May 2, 2017 10:58
SqliteService is an angular service in order to use the webSQL in your browser and sqlite DB in your device
(function(angular){
angular.module('Service.Sqlite',[])
.factory('SqliteService', function($cordovaSQLite){
var db = null;
function createDB(){
var queryCreate = "CREATE TABLE IF NOT EXISTS diary ( \
@ilgianfra
ilgianfra / gist:2577009317250185cf79
Created September 2, 2015 08:53
Proxy with gulp and browserSync
var gulp = require('gulp');
var url = require('url');
var proxy = require('proxy-middleware');
var browserSync = require('browser-sync');
// browser-sync task for starting the server.
gulp.task('browser-sync', function() {
var proxyOptions = url.parse('http://localhost:3000/secret-api');
proxyOptions.route = '/api';