angular/aio/content/examples/interpolation/src/app/app.component.ts
Ward Bell b08323747e docs: Migrate 2nd set of template guide pages and code to Standalone (#51632)
Supplements PR 51364 Template Migration with overlooked pages and examples

Code migrated: `inputs-outputs`, `interpolation`, `property-binding`
Guide pages affected:
* `binding-overview.md`
* `event-binding.md` (already migrated; updated with link to explain passive events)
* `inputs-outputs.md`
* `interpolation.md`
* `property-binding-best-practices.md`
* `property-binding.md`
* `understanding-template-expr-overview.md` (archived)

E2E tests passed locally.

PR Close #51632
2023-09-12 12:21:32 -07:00

30 lines
620 B
TypeScript

import { Component } from '@angular/core';
import { NgFor } from '@angular/common';
import { CUSTOMERS } from './customers';
@Component({
standalone: true,
selector: 'app-root',
templateUrl: './app.component.html',
imports: [ NgFor ],
styleUrls: ['./app.component.css']
})
export class AppComponent {
customers = CUSTOMERS;
// #docregion customer
currentCustomer = 'Maria';
// #enddocregion customer
title = 'Featured product:';
itemImageUrl = '../assets/potted-plant.svg';
recommended = 'You might also like:';
itemImageUrl2 = '../assets/lamp.svg';
getVal(): number { return 2; }
}