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 CLI version | Angular version | Node.js version | TypeScript version | RxJS version | |
---|---|---|---|---|---|
~16.0.0 | ~16.0.0 | ^16.13.0 || ^18.10.0 | >=4.9.5 <5.1.0 | ^6.5.5 || ^7.4.0 | |
~15.2.0 | ~15.2.0 | ^14.20.0 || ^16.13.0 || ^18.10.0 | >=4.8.4 <5.0.0 | ^6.5.5 || ^7.4.0 | |
~15.1.0 | ~15.1.0 | ^14.20.0 || ^16.13.0 || ^18.10.0 | >=4.8.4 <5.0.0 | ^6.5.5 || ^7.4.0 | |
~15.0.5 | ~15.0.4 | ^14.20.0 || ^16.13.0 || ^18.10.0 | ~4.8.4 | ^6.5.5 || ^7.4.0 | |
~14.3.0 | ~14.3.0 | ^14.15.0 || ^16.10.0 | >=4.6.4 <4.9.0 | ^6.5.5 || ^7.4.0 | |
~14.2.0 | ~14.2.0 | ^14.15.0 || ^16.10.0 | >=4.6.4 <4.9.0 | ^6.5.5 || ^7.4.0 | |
~14.1.3 | ~14.1.3 | ^14.15.0 || ^16.10.0 | >=4.6.4 <4.8.0 | ^6.5.5 || ^7.4.0 | |
~14.0.7 | ~14.0.7 | ^14.15.0 || ^16.10.0 | >=4.6.4 <4.8.0 | ^6.5.5 || ^7.4.0 | |
~13.3.0 | ~13.3.0 | ^12.20.2 || ^14.15.0 || ^16.10.0 | >=4.4.4 <4.7.0 | ^6.5.5 || ^7.4.0 |
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 routes: Routes = [ | |
{ | |
path: '', | |
redirectTo: '/dashboard', | |
pathMatch: 'full', | |
}, | |
{ | |
path: '', | |
component: MainLayoutComponent, | |
children: [ |
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 { Component, OnInit } from '@angular/core'; | |
import { Observable, Subject } from 'rxjs'; | |
import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators'; | |
import { Hero } from '../hero'; | |
import { HeroService } from '../hero.service'; | |
@Component({ | |
selector: 'app-hero-search', | |
templateUrl: './hero-search.component.html', |
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 { ChangeDetectionStrategy, Component } from '@angular/core'; | |
import { Observable, Subject } from 'rxjs'; | |
import { switchMap } from 'rxjs/operators'; | |
import { Hero } from '../hero'; | |
import { HeroService } from '../hero.service'; | |
@Component({ | |
changeDetection: ChangeDetectionStrategy.OnPush, | |
selector: 'app-hero-search', |
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 { Component, OnInit } from '@angular/core'; | |
import { Observable } from 'rxjs'; | |
import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; | |
import { Hero } from '../hero'; | |
@Component({ | |
selector: 'app-hero-search', | |
templateUrl: './hero-search.component.html', | |
styleUrls: [ './hero-search.component.css' ] |
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 { Observable, Subject } from 'rxjs'; | |
import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; | |
export class HeroSearchPresenter { | |
private searchTerms: Subject<string> = new Subject(); | |
searchTerms$: Observable<string> = this.searchTerms.pipe( | |
// wait 300ms after each keystroke before considering the term | |
debounceTime(300), | |
// ignore new term if same as previous term |
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 { | |
Component, | |
EventEmitter, | |
Input, | |
OnDestroy, | |
OnInit, | |
Output, | |
} from '@angular/core'; | |
import { Observable, Subject } from 'rxjs'; | |
import { debounceTime, distinctUntilChanged, takeUntil } from 'rxjs/operators'; |
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 { | |
ChangeDetectionStrategy, | |
Component, | |
EventEmitter, | |
Input, | |
OnDestroy, | |
OnInit, | |
Output, | |
} from '@angular/core'; | |
import { Subject } from 'rxjs'; |
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 { HttpClientModule } from '@angular/common/http'; | |
import { NgModule } from '@angular/core'; | |
import { PreSixModule } from './pre-six.module.ts'; | |
@NgModule({ | |
imports: [ | |
HttpClientModule, | |
PreSixModule, | |
], |
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 { ModuleWithProviders, NgModule } from '@angular/core'; | |
import { MyComponent } from './my.component'; | |
import { PreSixSingletonService } from './pre-six-singleton.service'; | |
@NgModule({ | |
declarations: [ | |
MyComponent, | |
], | |
}) |