mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Fixes some type checking issues in our own testing code that weren't showing up, because `strictTemplates` was turned off. PR Close #60481
37 lines
1 KiB
TypeScript
37 lines
1 KiB
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.dev/license
|
|
*/
|
|
import {Component, Input} from '@angular/core';
|
|
|
|
@Component({
|
|
selector: 'class-bindings',
|
|
template: `
|
|
<div>
|
|
<p>{{ msg }}</p>
|
|
<div *ngFor="let obj of list; let i = index" [title]="msg + i">
|
|
<span [class]="msg">{{ obj.text }}</span>
|
|
<span class="baz">one</span>
|
|
<span class="qux">two</span>
|
|
<div>
|
|
<span class="qux">three</span>
|
|
<span class="qux">four</span>
|
|
<span class="baz">five</span>
|
|
<div>
|
|
<span class="qux">six</span>
|
|
<span class="baz">seven</span>
|
|
<span [class]="msg">eight</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`,
|
|
standalone: false,
|
|
})
|
|
export class ClassBindingsComponent {
|
|
@Input() msg: string = '';
|
|
@Input() list: {i: number; text: string}[] | null = null;
|
|
}
|