Grid Layout is a two-dimensional and flexbox is a one-dimensional
Grid’s approach is layout-first and Flexbox’ approach is content-first
Flexbox small-scale layouts Grid’s larger scale
Grid is Container-Based, Flexbox is Content-Based
Ctrl+, User Settings
Ctrl+K Ctrl+S Keyboard Shortcuts
Ctrl+T Show all Symbols
Ctrl+G Go to Line...
Ctrl+P Go to File...
Ctrl+Shift+O Go to Symbol...
Ctrl+Space Trigger suggestion
Ctrl+. Quick Fix
@Component({ | |
selector: 'my-app', | |
templateUrl: './app.component.html', | |
}) | |
export class AppComponent { | |
form = this.formBuilder.group({ | |
firstName: [''], | |
lastName: [''], | |
age: [''], | |
}); |
Property | |
<img [src]="heroImageUrl"> | |
<app-hero-detail [hero]="currentHero"></app-hero-detail> | |
<div [ngClass]="{'special': isSpecial}"></div> | |
Event | |
<button (click)="onSave()">Save</button> |
/* | |
{ | |
"goodPackage": { | |
"upsellList": [ | |
{ | |
"productCode": "product1" | |
} | |
] |
import { Directive, Input, ElementRef, HostListener } from '@angular/core'; | |
@Directive({ | |
selector: '[appNumbersOnly]' | |
}) | |
export class NumbersOnlyDirective { | |
@Input() fieldMaxLength: number; | |
constructor(private _el: ElementRef) { } | |
@HostListener('keypress', ['$event']) onkeypress(event) { |
import { Directive, ElementRef, HostListener } from '@angular/core'; | |
@Directive({ | |
selector: '[appFocusfirstInvalidfield]' | |
}) | |
export class FocusfirstInvalidfieldDirective { | |
constructor(private el: ElementRef) { } | |
@HostListener('submit', ['$event']) |