Notes
Bind properties in a component’s template to properties in the component’s JavaScript class.
<template>
My name is: {name}!
</template>
In this template, {name} is a property. The properties must be written in curly braces.
{name} gets it's value directly from JavaScript file.
import { LightningElement } from 'lwc';
export default class Hello extends LightningElement {
name = 'John Carter';
}
The property in { } must be a valid JavaScript identifier or member expression. For example, {name} and {data.name} are both valid. Don’t add spaces around the property, for example, { name } is not valid HTML.