const greet = (obj) => {
return `${obj.greeting}, ${obj.firstName}${obj.lastName}`;
}
const greet = ({
/* | |
{ | |
"goodPackage": { | |
"upsellList": [ | |
{ | |
"productCode": "product1" | |
} | |
] |
Property | |
<img [src]="heroImageUrl"> | |
<app-hero-detail [hero]="currentHero"></app-hero-detail> | |
<div [ngClass]="{'special': isSpecial}"></div> | |
Event | |
<button (click)="onSave()">Save</button> |
@Component({ | |
selector: 'my-app', | |
templateUrl: './app.component.html', | |
}) | |
export class AppComponent { | |
form = this.formBuilder.group({ | |
firstName: [''], | |
lastName: [''], | |
age: [''], | |
}); |
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
React is a JavaScript library
React is not a framework (unlike Angular, which is more opinionated)
React is an open-source project created by Facebook
creating a new single-page app, use Create React App. server-rendered website with Node.js, try Next.js.
12 | |
# Check out to a temporary branch: | |
git checkout --orphan TEMP_BRANCH | |
# Add all the files: | |
git add -A | |
# Commit the changes: | |
git commit -am "Initial commit" |
import { Directive, HostListener, OnInit, Optional } from '@angular/core'; | |
import { NgControl } from '@angular/forms'; | |
@Directive({ | |
// tslint:disable-next-line:directive-selector | |
selector: 'input[trimInput],textarea[trimInput]', | |
}) | |
export class TrimInputDirective implements OnInit { | |
constructor(@Optional() private ngControl: NgControl) { |