parse function

List<TemplateAst> parse(
  1. String template, {
  2. required String sourceUrl,
  3. bool desugar = true,
  4. ExceptionHandler exceptionHandler = const ThrowingExceptionHandler(),
})

Returns template parsed as an abstract syntax tree.

If desugar is set, parsing will transform *directive and [(banana)] notations into their explicit forms using <template> and [value]="..." (valueChanged)="..." respectively.

Implementation

List<TemplateAst> parse(
  String template, {
  required String sourceUrl,
  bool desugar = true,
  ExceptionHandler exceptionHandler = const ThrowingExceptionHandler(),
}) {
  return const NgParser().parse(
    template,
    sourceUrl: sourceUrl,
    exceptionHandler: exceptionHandler,
    desugar: desugar,
  );
}