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
/** | |
* Created by Fabian on 19/10/2016. | |
*/ | |
import { Component, ElementRef, Input } from '@angular/core'; | |
import { Http } from '@angular/http'; | |
@Component({ | |
selector: 'file-upload', | |
template: '<input type="file" [attr.multiple]="multiple ? true : null" (change)="upload()" >' | |
}) | |
export class FileUploadComponent { |
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
//usage | |
const MY_STORE_TOKEN = new InjectionToken('MY_STORE_TOKEN'); | |
@NgModule({ | |
providers: [ | |
//on the ServerModule you want to provide | |
//ServerStateTransferModule | |
BrowserStateTransferModule, | |
//helper function which will provide the store accosiated with this token |
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 { Component, PLATFORM_ID , Inject} from '@angular/core'; | |
import { isPlatformServer } from '@angular/common' | |
import { TransferState , makeStateKey} from '@angular/platform-browser'; | |
import { HttpClient } from '@angular/common/http' | |
interface CounterState { | |
count: number; | |
} | |
const COUNTER_KEY = makeStateKey<CounterState>('my-counter'); |
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
export function validate(module: any, bootstrapComponent: any, selector = 'app-root', timeout = 5000) { | |
@NgModule({ | |
imports: [ | |
BrowserModule.withServerTransition({ appId: selector }), | |
module | |
], | |
declarations: [bootstrapComponent], | |
bootstrap: [bootstrapComponent], | |
}) | |
class AppModule { } |
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
let [root] = getAllAngularRootElements(); | |
let appRoot = ng.probe(root); | |
let [rootComponent] = appRoot.injector.get(ng.coreTokens.ApplicationRef).components; | |
let ChangeDetectorRef = rootComponent.changeDetectorRef.constructor.prototype; | |
ChangeDetectorRef.constructor.prototype.detectChanges = (function () { | |
let oldDC = ChangeDetectorRef.constructor.prototype.detectChanges; | |
let map = new WeakMap(); | |
return function () { | |
Zone.root.run(() => showChangeDetection(this)); | |
return oldDC.apply(this, arguments); |
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 { ChildProcess, spawn } from 'child_process'; | |
import * as execa from 'execa'; | |
const nodeCleanup = require('node-cleanup'); | |
const terminate = require('terminate'); | |
process.env.NODE_ENV = 'e2e'; | |
let childProcesses: ChildProcess[] = []; | |
function start(cmd: string) { | |
const proc = execa.shell(cmd); |
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":"2018-08-09T03:53:20.393Z","extensionVersion":"v3.0.0"} |
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
const fs = require('fs'); | |
const path = require('path'); | |
const JasmineRunner = require('jasmine/lib/jasmine'); | |
const {createInterface} = require('readline'); | |
const UTF8 = { | |
encoding: 'utf-8' | |
}; | |
// These exit codes are handled specially by Bazel: |
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 'zone.js/dist/zone-node'; | |
import 'reflect-metadata'; | |
import * as http from 'http'; | |
import * as fs from 'fs'; | |
import * as util from 'util'; | |
import * as path from 'path'; | |
import * as url from 'url'; | |
import * as mime from 'mime-types'; | |
import * as os from 'os'; | |
import { ɵCommonEngine as CommonEngine } from '@nguniversal/common/engine'; |
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 * as querystring from 'querystring'; | |
function isObject(arg: any) { | |
return typeof(arg) === 'object' && arg !== null; | |
} | |
const slashedProtocol = { | |
http: true, | |
https: true, | |
ftp: true, |
OlderNewer