This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2019-01-10T16:58:40.846Z","extensionVersion":"v3.2.4"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { renderModuleFactory } from '@angular/platform-server'; | |
import { enableProdMode } from '@angular/core'; | |
import { AppServerModuleNgFactory } from './aot/src/app/app.server.module.ngfactory'; | |
import * as express from 'express'; | |
import * as fs from 'fs'; | |
enableProdMode(); | |
const app = express(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Wilib: lightweigth JQuery clone with no ie support | |
// $ is replace by W | |
window.W = function(selector) { | |
if (selector[0] == '<' && selector[selector.length - 1] == '>') { | |
var elem = selector.replace('>', '').replace('<', ''); | |
var node = document.createElement(elem); | |
wObject(node); | |
return node; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postJSON = function(url,data){ | |
return new Promise(function(resolve,reject) | |
{ | |
var req = new XMLHttpRequest(); | |
req.open('POST', url, true); | |
req.onreadystatechange = function () { | |
if (req.readyState == 4) { | |
if(req.status == 200) | |
resolve(JSON.parse(req.responseText)); | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Array select | |
usage : [{name : "William", age : 24}, {name : "Bertrand", age : 47}].select('age'); | |
=> return : [{age : 24}, {age : 47}] | |
parameter can be a string or an Array of prop to select*/ | |
Array.prototype.select = function(props){ | |
var newArray = []; | |
this.forEach(function(e){ | |
var newObj = {}; | |
if(typeof(props) === "string") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getJSON = function(url,data){ | |
return new Promise(function(resolve,reject) | |
{ | |
var req = new XMLHttpRequest(); | |
req.open('GET', url, true); | |
req.onreadystatechange = function () { | |
if (req.readyState == 4) { | |
if(req.status == 200) | |
resolve(JSON.parse(req.responseText)); | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var where = function(data, predicate) { | |
var newArray = []; | |
data.forEach(function(e) { | |
var add = true; | |
for (pred in predicate) { | |
if (predicate[pred] != e[pred]) { | |
add = false; | |
break; | |
} | |
} |