Следите за новинками
в нашем Telegram канале. Жми, чтобы подписаться:)
⊗jsagPmTpTCM 18 of 97 menu
◀ ▶

Component class methods in Angular template

In the layout, you can also call public methods of the class. Let's see in practice. Let's say we have the following method:

export class AppComponent { public show() { return 'abcde'; } }

Let's call it in the layout:

<div> {{ show() }} </div>

Let the component class have the following methods:

export class AppComponent { public showName() { return 'john'; } public showSurn() { return 'smit'; } }

Display the first and last name in the component template file.

← →
↑
English▼
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline