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
(function (angular) { | |
'use strict'; | |
angular.module('app').directive('setActiveLink', function ($location) { | |
return { | |
restrict: 'A', | |
link: function (scope, element, attrs) { | |
if (!attrs || !attrs.href) return; | |
var url = attrs.href.replace('#', ''); |
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
(function (angular) { | |
'use strict'; | |
angular.module('app').filter('customnumber', function () { | |
return function (input) { | |
return roundToTwo(parseFloat(input) + "e+2").toFixed(2).replace('.', ','); | |
}; | |
function roundToTwo(num) { | |
return +(Math.round(num) + "e-2"); |
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
(function(angular) { | |
'use strict'; | |
angular.module('app').filter('dutchmoney', function () { | |
return function(input) { | |
var result = roundToTwo(parseFloat(input) + 'e+2').toFixed(2).replace('.', ','); | |
return isNaN(result) ? "" : result; | |
}; | |
function roundToTwo(num) { |
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 {Injectable} from 'angular2/core'; | |
import {guid} from '../../../helpers'; | |
export const ADD_TOAST = 'ADD_TOAST'; | |
export const REMOVE_TOAST = 'REMOVE_TOAST'; | |
export const FADE_TOAST = 'FADE_TOAST'; | |
@Injectable() | |
export class ToastrActionCreator { | |
constructor() { |
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 {Store} from '@ngrx/store'; | |
export abstract class BaseService { | |
state: any; | |
constructor(protected store: Store<any>) { | |
this.store.subscribe(s => this.state = s); | |
} | |
} |
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 guid() { | |
function s4() { | |
return Math.floor((1 + Math.random()) * 0x10000) | |
.toString(16) | |
.substring(1); | |
} | |
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + | |
s4() + '-' + s4() + s4() + s4(); | |
} |
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 '../settings/_colours.scss'; | |
@import '../settings/_typography.scss'; | |
body { | |
width: 100%; | |
height: 100%; | |
min-height: 100vh; | |
background-color: md-color($vir-app-ui, 50); | |
font-family: $font-stack; |
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
///////// | |
// LESSION MATERIAL FOR .map, .filter, .reduce, function composition and currying | |
///////// | |
const list = [1, 2, 3, 4, 5]; | |
const anotherList = ['h', 'e', 'l', 'l', 'o']; | |
let result; | |
// map is used to transform each element in the array |
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 {Injectable} from '@angular/core'; | |
import {window} from '@angular/platform-browser/src/facade/browser'; | |
@Injectable() | |
export class StorageService { | |
// todo: make these configurable, have a look at | |
// https://github.com/phenomnomnominal/angular-2-local-storage/ | |
private prefix = 'my_ng2_app'; | |
private storageType: 'sessionStorage' | 'localStorage' = 'sessionStorage'; | |
private storage: any; |
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
<?php | |
/* | |
Plugin Name: Tools Loader | |
Description: A plugin to load project-specific AngularJS snippets (mini apps) using shortcodes. | |
Version: 0.1 alpha | |
Author: Jeroen Berndsen | |
Author URI: http://www.jberndsen.nl | |
*/ | |
// load requirejs |
OlderNewer