A simple method to "trap" tabbing inside an element
const trapper = new FocusTrapper(element)
trapper.trap() // To trap focus
trapper.untrap() // To release
/** | |
* This interceptor ensures that the app makes requests | |
* with relative paths correctly server-side. | |
* Requests which start with a dot (ex. ./assets/...) | |
* or relative ones ( ex. /assets/...) will be converted | |
* to absolute paths | |
*/ | |
import { Inject, Injectable, Injector, PLATFORM_ID } from '@angular/core'; | |
import { isPlatformServer } from '@angular/common'; | |
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; |
Angular (aka Angular 2) is a new framework completely rewritten from the ground up, replacing the famous AngularJS framework (aka Angular 1.x).
More that just a framework, Angular should now be considered as a whole platform which comes with a complete set of tools, like its own CLI, debug utilities or performance tools.
"scripts": { | |
"clean": "rimraf dist/*", | |
"prebuild": "npm run clean -s", | |
"build": "npm run build:scripts -s && npm run build:styles -s && npm run build:markup -s", | |
"build:scripts": "browserify -d assets/scripts/main.js -p [minifyify --compressPath . --map main.js.map --output dist/main.js.map] | hashmark -n dist/main.js -s -l 8 -m assets.json 'dist/{name}{hash}{ext}'", | |
"build:styles": "stylus assets/styles/main.styl -m -o dist/ && hashmark -s -l 8 -m assets.json dist/main.css 'dist/{name}{hash}{ext}'", | |
"build:markup": "jade assets/markup/index.jade --obj assets.json -o dist", | |
"test": "karma start --singleRun", | |
"watch": "parallelshell 'npm run watch:test -s' 'npm run watch:build -s'", | |
"watch:test": "karma start", |
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
//----- The ECMAScript 6 meta object protocol (MOP) implemented in ES5 | |
// This is how getting a property is handled internally. | |
// Double underscore (__) implies internal operation. | |
Object.prototype.__Get__ = function (propKey, receiver) { | |
receiver = receiver || this; | |
var desc = this.__GetOwnProperty__(propKey); | |
if (desc === undefined) { | |
var parent = this.__GetPrototypeOf__(); | |
if (parent === null) return undefined; |
"use strict"; | |
(function() { | |
var intervalID = null; | |
function startCheckingNetworkConnection() { | |
intervalID = setInterval(function() { | |
var networkState = navigator.connection.type; | |
var isWifi = networkState == Connection.WIFI; |