Skip to content

Instantly share code, notes, and snippets.

View hansl's full-sized avatar
🏠
Working from home

Hans Larsen hansl

🏠
Working from home
View GitHub Profile

Angular CLI Reference

ng new

ng new <project-name> [options]
Creates a new Angular project. By default, the project is created under
the current directory.

Options:
  --dry-run           only output the files created and operations performed, do

not actually create the project.

<div class="md-tab-header" role="tablist"
(keydown.arrowRight)="focusNextTab()"
(keydown.arrowLeft)="focusPreviousTab()"
(keydown.enter)="selectedIndex = focusIndex">
<div class="md-tab-label" role="tab" md-tab-label-wrapper
*ngFor="let tab of _tabs; let i = index"
[id]="_getTabLabelId(i)"
[tabIndex]="selectedIndex == i ? 0 : -1"
[attr.aria-controls]="_getTabContentId(i)"
[attr.aria-selected]="selectedIndex == i"
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
6493ms building modules
10ms sealing
0ms optimizing
0ms basic module optimization
14ms module optimization
0ms advanced module optimization
6ms basic chunk optimization
0ms chunk optimization
  • Never have two inputs in your API for the same metric.
@hansl
hansl / index.ts
Last active December 31, 2017 21:43
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
// You don't have to export the function as default. You can also have more than one rule factory
// per file.
export function myComponent(options: any): Rule {
return (tree: Tree, _context: SchematicContext) => {
return tree;
};
}
@hansl
hansl / index.ts
Last active February 1, 2018 00:36
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
// You don't have to export the function as default. You can also have more than one rule factory
// per file.
export function myComponent(options: any): Rule {
return (tree: Tree, _context: SchematicContext) => {
tree.create(options.name || 'hello', 'world');
return tree;
};
@hansl
hansl / index.ts
Last active January 11, 2018 22:20
import { Rule, SchematicContext, Tree, chain, externalSchematic } from '@angular-devkit/schematics';
const licenseText = `
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/