/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
devtools/projects/ng-devtools/src/lib/shared/button/button.component.ts
30 строк
904 B
hawkgs
refactor(devtools): drop explicit OnPush change detection strategy
25 мар 2026, 22:58
25 мар 2026, 22:58
0ad18ee
Код
Авторство
О чём код?
/** * @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, input} from '@angular/core'; type ButtonType = 'primary' | 'secondary' | 'icon'; type ButtonSize = 'standard' | 'mid' | 'compact'; @Component({ selector: 'button[ng-button]', template: '<ng-content/>', styleUrl: './button.component.scss', host: { class: 'ng-button', '[class.type-primary]': `btnType() === 'primary'`, '[class.type-secondary]': `btnType() === 'secondary'`, '[class.type-icon]': `btnType() === 'icon'`, '[class.size-compact]': `size() === 'compact'`, '[class.size-mid]': `size() === 'mid'`, }, }) export class ButtonComponent { readonly btnType = input<ButtonType>('primary'); readonly size = input<ButtonSize>('standard'); }