Compare commits
2 Commits
3812a8a323
...
71c242f9f2
Author | SHA1 | Date | |
---|---|---|---|
71c242f9f2 | |||
382e5263bf |
8117
package-lock.json
generated
8117
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -5,7 +5,7 @@ import { UpperCasePipe } from '@angular/common';
|
||||
import { TextPipe } from '../text.pipe';
|
||||
import { HotelService } from './Parent/services/hotel.service';
|
||||
import { inject } from '@angular/core';
|
||||
import { filter, map, Observable } from 'rxjs';
|
||||
import { filter, map, Observable, range } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
@ -20,27 +20,20 @@ export class AppComponent {
|
||||
public hotelService: HotelService = inject(HotelService);
|
||||
|
||||
ngOnInit() {
|
||||
const stream: Observable<number> = new Observable((observer) => {
|
||||
observer.next(1);
|
||||
observer.next(2);
|
||||
observer.next(3);
|
||||
observer.next(4);
|
||||
observer.next(5);
|
||||
observer.next(6);
|
||||
observer.next(7);
|
||||
observer.next(8);
|
||||
observer.next(9);
|
||||
observer.next(10);
|
||||
observer.complete();
|
||||
});
|
||||
const stream: Observable<number> = range(1, 10);
|
||||
|
||||
stream.pipe(
|
||||
filter((value:number) => value % 2 === 1),
|
||||
map((value:number) => value * 2)
|
||||
filter((value: number) => value % 2 === 1),
|
||||
).subscribe((value) => console.log(value));
|
||||
console.log('---')
|
||||
|
||||
stream.pipe(
|
||||
map((value: number) => value * 2)
|
||||
).subscribe((value) => console.log(value));
|
||||
}
|
||||
|
||||
public test() {
|
||||
8
|
||||
console.log(this.search);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user