template property

String? template
final

An inline HTML template for this component.

Use template to define the component's view directly in Dart. For larger templates, prefer templateUrl to load from an external file.

Example

@Component(
  selector: 'my-comp',
  template: '<h1>Hello {{name}}!</h1>',
)
class MyComponent {
  String name = 'World';
}

Implementation

final String? template;