Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
interface Obj<T> { elemA: T; elemB: T; } const list: Obj<string> = { elemA: "sdfsdf", elemB: "fsdfweff" }; const list2: Obj<number> = { elemA: 123, elemB: 234 };
import { interval } from 'rxjs'; import { switchMap } from 'rxjs/operators'; const requests$ = interval(300).pipe( switchMap(() => http.get('path')) )
if (show != this.toggle) { // check if it change, tell CD update view this.toggle = show; this.user = this.authService.currentUser.name; } else { this.user = ''; } this.cdRef.detectChanges();
this.cdRef.detectChanges()
RouterModule.forRoot(routes, { useHash: true })
const appRoutes: Routes = [{ path: '', redirectTo: '/index1', pathMatch: 'full' } ];
set setCurrency(currency: 'RUB'|'USD'|'EUR'|'AUD') { this.preferences.currency = currency; }
type Currencies = 'RUB'|'USD'|'EUR'|'AUD'