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.
AngularDart: 'nGBootstrap is not defined' error
-
04-07-2023 - |
Pergunta
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'.
Solução
Outras dicas
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.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow