angular/devtools/src/app/demo-app/heavy.component.ts
Matthieu Riegler 6cd91c675c refactor(devtools): enables typescript strict option (#53340)
Enabling `strict` is part of an effort to improve the quality of the devtools code base.
One of the direct side effect is to enable `noImplicitAny`, `strictPropertyInitialization` and `strictBindCallApply`.

This commit also replaces `fullTemplateTypeCheck` with `stringTemplates`.

PR Close #53340
2023-12-05 12:42:56 -08:00

47 lines
857 B
TypeScript

/**
* @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.io/license
*/
import {Component, Input} from '@angular/core';
const fib = (n: number): number => {
if (n === 1 || n === 2) {
return 1;
}
return fib(n - 1) + fib(n - 2);
};
@Component({
selector: 'app-heavy',
templateUrl: './heavy.component.html',
styleUrls: ['./heavy.component.scss'],
})
export class HeavyComponent {
@Input()
set foo(_: any) {
}
state = {
nested: {
props: {
foo: 1,
bar: 2,
},
[Symbol(3)]():
number {
return 1.618;
},
get foo():
number {
return 42;
},
},
};
calculate(): number {
return fib(15);
}
}