/
jonca3d
/
tiketSales
Обзор
Документация
Войти
/
jonca3d
/
tiketSales
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/app/app.component.ts
60 строк
2 KB
Evgeniy
rxjs theme3
21 ноя 2024, 22:17
21 ноя 2024, 22:17
08c6390
Код
Авторство
О чём код?
import { Component } from '@angular/core'; import { ObservableExampleService } from './services/testing/observable-example.service'; import { AuthService } from './services/auth/auth.service'; import { IUser } from './models/IUser'; import { ConfigService } from './services/config/config.service'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], }) export class AppComponent { title = 'ticketSales2022'; prop: string; constructor( private testing: ObservableExampleService, private configService: ConfigService ) {} ngOnInit() { this.configService.configLoad(); // const myObservable = this.testing.getObservable(); // myObservable.subscribe((data) => { // console.log('first myObservable data', data); // }); // myObservable.subscribe((data) => { // console.log('second myObservable data', data); // }); // const mySubject = this.testing.getSubject(); // mySubject.subscribe((data) => { // console.log('first data subject', data); // }); // mySubject.subscribe((data) => { // console.log('second data subject', data); // }); // mySubject.next('subject value'); // mySubject.next('subject value'); // const myBehavior = this.testing.getBehaviorSubject(); // myBehavior.subscribe((data) => { // console.log('first data behaviorSubject', data); // }); // myBehavior.next('new data from behajviorSubject'); // myBehavior.next('new data1 from behajviorSubject'); // myBehavior.subscribe((data) => { // console.log('sec data behaviorSubject', data); // }); // myBehavior.next('new data2 from behajviorSubject'); // myBehavior.next('new data3 from behajviorSubject'); } }