Skip to content

Instantly share code, notes, and snippets.

@rossholdway
rossholdway / activated-route-stub.ts
Last active May 19, 2020 20:11
Stub Angular 2+ routers activatedRoute.
import {
DefaultUrlSerializer,
convertToParamMap,
ParamMap,
Params,
UrlSegment,
UrlSegmentGroup,
PRIMARY_OUTLET
} from '@angular/router';
import { ReplaySubject } from 'rxjs';
@rossholdway
rossholdway / Ionic environment
Last active January 5, 2021 21:19
A script to run before the ionic build process that generates an app.config.ts file based off of a .env/{environment}.json file. See this comment for more info: https://github.com/ionic-team/ionic-app-scripts/issues/762#issuecomment-295235407
#!/usr/bin/env node
var path = require('path');
var process = require('process');
var fs = require('fs');
class Environment {
constructor(args) {
args = JSON.parse(args).original;
const defaultEnv = 'development'; //Set default environment
let env;