angular_ast

Parser and utilities for AngularDart templates.

This package is platform agnostic (no HTML or Dart VM dependencies).

Usage

Currently in development and not stable.

import 'package:angular_ast/angular_ast.dart';

main() {
  // Create an AST tree by parsing an AngularDart template.
  var tree = parse('<button [title]="someTitle">Hello</button>');

  // Print to console.
  print(tree);

  // Output:
  // [
  //    ElementAst <button> { 
  //      properties=
  //        PropertyAst {
  //          title="ExpressionAst {someTitle}"} 
  //          childNodes=TextAst {Hello} 
  //      }
  //    }
  // ]
}

Libraries

angular_ast