/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
adev/src/app/main.component.ts
32 строки
914 B
Matthieu Riegler
docs(docs-infra): remove explicit OnPush
25 мар 2026, 22:58
25 мар 2026, 22:58
1938054
Код
Авторство
О чём код?
/*! * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {Component, effect, inject, model} from '@angular/core'; import {IS_SEARCH_DIALOG_OPEN, Search} from '@angular/docs'; import {RouterOutlet} from '@angular/router'; @Component({ selector: 'adev-main', imports: [RouterOutlet], template: `<router-outlet />`, }) export default class MainComponent { private readonly displaySearchDialog = inject(IS_SEARCH_DIALOG_OPEN); private readonly searchService = inject(Search); readonly search = model<string | undefined>(''); constructor() { effect(() => { const search = this.search(); if (search !== undefined) { this.displaySearchDialog.set(true); this.searchService.searchQuery.set(search); } }); } }