Skip to content

Instantly share code, notes, and snippets.

@jessemorton
jessemorton / params.service.ts
Created January 26, 2018 22:07
Get all param values from Angular
import {Injectable} from "@angular/core";
import {Router} from "@angular/router";
/**
* Based off https://stackoverflow.com/a/42301718/4185989
*/
@Injectable()
export class ParamsService {
constructor(
public router: Router
@jessemorton
jessemorton / index.js
Created February 1, 2016 15:37
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var parsley = require('parsleyjs');
var $ = require('jquery');
window.Parsley.addAsyncValidator('unique-username', function(xhr) {
return xhr.status === 200;
}, '/api/users/unique_validator', {
"type": 'POST',
"dataType": 'json'