⊗jsagPmTpCPO 17 of 97 menu

Properties-objects in a template in Angular

You can also output objects in the layout. Let's see in practice. Let's say we have the following object:

export class AppComponent { public obj = {'a': 1, 'b': 2, 'c': 3}; }

Let's display the contents of our object in the layout:

<div> {{ obj.a }} {{ obj.b }} {{ obj.c }} </div>

The following object is given:

export class AppComponent { public user = { name: 'john', surn: 'smit', }; }

List each element of this object in a separate paragraph.

The following object is given:

export class AppComponent { public user = { img: 'pic.png', alt: 'picture', }; }

Output the elements of this object as the following markup:

<img src="pic.png" alt="picture">
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