Angular CLI version | Angular version | Node.js version | TypeScript version |
---|---|---|---|
- | 2.x | 6.0.x or later minor version | 2.0.x |
1.0.6 | 4.x | 6.9.x or later minor version | 2.2.x |
1.1.3 | 4.x | 6.9.x or later minor version | 2.3.x |
1.2.7 | 4.x | 6.9.x or later minor version | 2.3.x |
1.3.2 | 4.2.x or later minor version | 6.9.x or later minor version | 2.4.x |
1.4.10 | 4.2.x or later minor version | 6.9.x/8.9.x or later minor version | 2.4.x |
(1.5.6) | 5.0.x | 6.9.x/8.9.x or later minor version | 2.4.x |
1.5.6 | 5.1.x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h3>Top Heroes</h3> | |
<div class="grid grid-pad"> | |
<a *ngFor="let hero of heroes" class="col-1-4" | |
routerLink="/detail/{{hero.id}}"> | |
<div class="module hero"> | |
<h4>{{hero.name}}</h4> | |
</div> | |
</a> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const childProcess = require('child_process'); | |
const fs = require('fs'); | |
const yargs = require('yargs'); | |
function addScopeToLibraryProjectName({ name, scope }) { | |
runCommand('npx json -I -f angular.json ' | |
+ `-e "this.projects['${scope}-${name}'] = this.projects['${name}']"`); | |
runCommand(`npx json -I -f angular.json -e "delete this.projects['${name}']"`); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Angular version | Application engine | Library engine | Status | |
---|---|---|---|---|
Version 9 | View Engine | View Engine | Supported, but not recommended | |
Version 9 | View Engine | Ivy | Not supported | |
Version 9 | Ivy | View Engine | Recommended | |
Version 9 | Ivy | Ivy | Supported, but not recommended | |
Version 10 | View Engine | View Engine | Supported, but not recommended | |
Version 10 | View Engine | Ivy | Not supported | |
Version 10 | Ivy | View Engine | Supported, but not recommended | |
Version 10 | Ivy | Ivy | Recommended | |
Version 11 | View Engine | View Engine | Not supported |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
Type, | |
ɵNG_COMP_DEF, | |
ɵNG_DIR_DEF, | |
ɵNG_MOD_DEF, | |
ɵNG_PIPE_DEF, | |
} from '@angular/core'; | |
function isIvy(): boolean { | |
const ng: any = ((self || global || window) as any).ng; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<todo-app component="./todo-app-component"> | |
<item component="./todo-component"> | |
<input type=”checkbox” checked click> | |
<span class=”done”>Research</span> | |
</item> | |
<item component="./todo-component"> | |
<input type=”checkbox” click> | |
<span>Development</span> | |
</item> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { InjectionToken } from '@angular/core'; | |
// We create an interface for the configuration JSON object | |
export interface Configuration { | |
readonly apiUrl: string; | |
readonly timezone: string; | |
readonly websocketUrl: string; | |
} | |
// We use a dependency injection token to access the configuration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h3>Cart</h3> | |
<p> | |
<a routerLink="/shipping">Shipping Prices</a> | |
</p> | |
<div class="cart-item" *ngFor="let item of items"> | |
<span>{{ item.name }} </span> | |
<span>{{ item.price | currency }}</span> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { FormBuilder } from '@angular/forms'; | |
import { Customer } from '../../customer'; | |
@Injectable() | |
export class CheckoutPresenter { | |
form = this.formBuilder.group({ | |
name: '', | |
address: '', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form [formGroup]="checkoutForm" (ngSubmit)="onSubmit()"> | |
<div> | |
<label for="name"> | |
Name | |
</label> | |
<input id="name" type="text" formControlName="name"> | |
</div> | |
<div> | |
<label for="address"> |