Domanda

I'm trying to run this simple code from here

import 'package:angular/angular.dart';
  void main() {
    ngBootstrap();
  }

But i recieve this error:

The function 'ngBootstrap' is not defined

Any idea about what's happening? I already tried 'pub get'.

È stato utile?

Soluzione

Lastest angular version is 0.9.11.
So, you must use ngDynamicApp().addModule(new MyAppModule()).run(); instead of ngBootstrap(module: new MyAppModule());,
and add import 'package:angular/angular_dynamic.dart'; in your main.dart.

Altri suggerimenti

Lastest angular version is 0.10.0.

So, now you must use applicationFactory().addModule(new MyAppModule()).run(); instead of ngDynamicApp().addModule(new MyAppModule()).run();, and always add import 'package:angular/angular_dynamic.dart'; in your main.dart.

Be careful, many thing has changed, like we use Component without @... etc.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top