/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
devtools/src/app/demo-app/sample-properties.component.ts
52 строки
1 KB
Milo
fix(devtools): fix some build errors from g3 typescript (#62412)
11 июл 2025, 20:35
11 июл 2025, 20:35
1de7ab2
Код
Авторство
О чём код?
/** * @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, computed, ElementRef, inject, signal, viewChild} from '@angular/core'; import {SIGNAL} from '@angular/core/primitives/signals'; import {SampleService} from './sample.service'; @Component({ selector: 'app-sample-properties', template: '', styles: [''], }) export class SamplePropertiesComponent { readonly elementRef = viewChild<ElementRef>('elementReference'); exampleService = inject(SampleService); exampleBoolean = true; exampleString = 'John'; exampleSymbol = Symbol.iterator; exampleNumber = 40; exampleBigint = BigInt(40); exampleUndefined = undefined; exampleNull = null; exampleObject = {name: 'John', age: 40}; exampleArray = [1, 2, [3, 4], {name: 'John', age: 40, skills: ['JavaScript']}]; exampleSet = new Set([1, 2, 3, 4, 5]); exampleMap = new Map<unknown, unknown>([ ['name', 'John'], ['age', 40], [{id: 123}, undefined], ]); exampleDate = new Date(); exampleFunction = () => 'John'; signalPrimitive = signal(123); computedPrimitive = computed(() => this.signalPrimitive() ** 2); signalObject = signal({name: 'John', age: 40}); computedObject = computed(() => { const original = this.signalObject(); return {...original, age: original.age + 1}; }); signalSymbol = SIGNAL; }