mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
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
47 lines
857 B
TypeScript
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);
|
|
}
|
|
}
|