This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)
Given the code
| <md-input-container class="admin-form"> | |
| <input md-input placeholder="Block Title" nfNoSpaces [(ngModel)]="block.title" id="block-{{ block.id }}-input-name" name="title" | |
| #title="ngModel"> | |
| <md-hint [ngStyle]="{'color': 'red'}" align="start" *ngIf="!title.valid && !title.pristine">Title is required.</md-hint> | |
| </md-input-container> | |
| Be sure to include ref to directive in module declarations array. |
| import getYear from 'date-fns/get_year' | |
| import getMonth from 'date-fns/get_month' | |
| import addDays from 'date-fns/add_days' | |
| import startOfWeek from 'date-fns/start_of_week' | |
| const rows = range(6) | |
| const cols = range(7) | |
| /** | |
| * Returns a two-dimensional array with calendar represented dates |
| (function (window, document, Chartist) { | |
| 'use strict'; | |
| function AutoScaleAxis(axisUnit, data, chartRect, options) { | |
| // Usually we calculate highLow based on the data but this can be overriden by a highLow object in the options | |
| var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos); | |
| this.bounds = Chartist.getBounds(chartRect[axisUnit.rectEnd] - chartRect[axisUnit.rectStart], highLow, options.scaleMinSpace || 20, options.onlyInteger); | |
| var scale = options.scale || 'linear'; |
| <!-- Add this code if you would like accordions on your Category Page --> | |
| <div class="container-divider"></div> | |
| <div class="container"> | |
| <nav class="sub-nav"> | |
| {{breadcrumbs}} | |
| {{search submit=false}} | |
| </nav> | |
| import {PipeTransform, Pipe} from 'angular2/core'; | |
| @Pipe({ name: 'highlight' }) | |
| export class HighLightPipe implements PipeTransform { | |
| transform(text: string, [search]): string { | |
| return search ? text.replace(new RegExp(search, 'i'), `<span class="highlight">${search}</span>`) : text; | |
| } | |
| } | |
| /** Usage: |
| /** | |
| * Sorts an array of objects In-Place, | |
| * sorting by multiple fields sequentially. | |
| * | |
| * @description This function is meant to be used | |
| * with arrays of objects, AND when you need to set | |
| * multiple sorting criteria. For other cases it is | |
| * recommended to use the native method `array.sort(callback)` | |
| * since for simple cases this function is more expensive | |
| * in time and memory. |
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
| <style type="text/css"> | |
| /* | |
| * Allows to usage of <ul> as .row and <li> as .col-**-* | |
| * Benefit of using <li> is that the column can be of varied height, | |
| * unlike when using div.row - columns collapse when heights are different. | |
| * The tricky part is to eliminate whitespaces between <li></li> tags. | |
| * | |
| * Usage: <ul class="list-grid row"> | |
| * <li class="col-md-3">...</li> | |
| * |
npm shrinkwrap is useful, but maddening (once it's in place and you want to update a package).
Say you've got a package.json with module ember-cli as a devDependency currently at version 1.13.1. And you have an npm-shrinkwrap.json file too, generated with the --dev flag.
If you change the version of ember-cli to, say, 1.13.8 in package.json and run npm install, nothing will happen.
If you do that and manually change references in the shrinkwrap file, you will still have trouble (as nested dependencies may now be incorrect).