mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Guide pages do not mention `NgModule` so they are untouched (and not "reviewed" either). All code was migrated, including code in the `template-expression-operators` folder despite it only being referenced in the “archived” guide, `template-expression-operators.md`. PR Close #51364
18 lines
450 B
TypeScript
18 lines
450 B
TypeScript
import { Component } from '@angular/core';
|
|
|
|
@Component({
|
|
standalone: true,
|
|
selector: 'app-svg',
|
|
templateUrl: './svg.component.svg',
|
|
styleUrls: ['./svg.component.css']
|
|
})
|
|
export class SvgComponent {
|
|
fillColor = 'rgb(255, 0, 0)';
|
|
|
|
changeColor() {
|
|
const r = Math.floor(Math.random() * 256);
|
|
const g = Math.floor(Math.random() * 256);
|
|
const b = Math.floor(Math.random() * 256);
|
|
this.fillColor = `rgb(${r}, ${g}, ${b})`;
|
|
}
|
|
}
|