0

I tried di Code Generator from the AngularDart tutorial but the generated code contains a lot of lines like:

"incrementHours()": (scope) => ensureFunction(_incrementHours(scope), "incrementHours")(),

but the function ensureFunction() is unknown.

Any idea what I'm doing wrong?

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567

1 Answers1

1

It's not di generator, but angular static parser generator that generates those lines. Please make sure that you have the following imports in the parser header file.

import 'package:angular/angular.dart';
import "package:angular/core/parser/utils.dart";
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
pavelgj
  • 2,246
  • 11
  • 13
  • Thanks your for the info. I used the files from the angular.dart.tutorial which seems to not have this core/parser/utils import either. https://github.com/angular/angular.dart.tutorial/blob/master/Chapter_07/lib/parser_gen_header.dart – Günter Zöchbauer Jan 21 '14 at 18:45
  • The tutorial might be a bit broken at the moment. Track here https://github.com/angular/angular.dart.tutorial/issues/35 – pavelgj Jan 21 '14 at 18:47
  • Thanks! Got it working. Using static injector seems to provide huge performance improvement. – Günter Zöchbauer Jan 23 '14 at 06:23