Я экспериментирую с пользовательским рендерером для Angular2.Пользовательский рендер для Angular2
Я установил простой example project с минимальным приложением Angular2 (AppComponent
), которое я хотел бы запустить на Node.js. Я внедрил пользовательский DomAdapter и пользовательский Renderer (просто манекен, который должен войти в консоль), затем я попытаюсь связать все вместе в custom bootstrap code.
В настоящее время я застрял со следующим сообщением об ошибке:
Error: No precompiled component AppComponent found
at new BaseException (/home/ralf/git/node-angular-example/node_modules/angular2/src/facade/exceptions.js:15:23)
at Compiler_.compileInHost (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/linker/compiler.js:47:19)
at DynamicComponentLoader_.loadAsRoot (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/linker/dynamic_component_loader.js:101:31)
at di_1.provide.useFactory (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/application_ref.js:29:47)
at Injector._instantiate (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/di/injector.js:763:27)
at Injector._instantiateProvider (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/di/injector.js:714:25)
at Injector._new (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/di/injector.js:703:21)
at InjectorInlineStrategy.getObjByKeyId (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/di/injector.js:216:33)
at Injector._getByKeyDefault (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/di/injector.js:899:37)
at Injector._getByKey (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/di/injector.js:845:25)
Может кто-нибудь объяснить, что это значит, и чего не хватает?
Update: Как Tobias Bosch указал, COMPILER_PROVIDERS
отсутствовали. Однако после их добавления я получаю еще одну ошибку:
Error: DI Exception
at NoProviderError.BaseException [as constructor] (/home/ralf/git/angular2-renderer-example/node_modules/angular2/src/facade/exceptions.js:15:23)
at NoProviderError.AbstractProviderError [as constructor] (/home/ralf/git/angular2-renderer-example/node_modules/angular2/src/core/di/exceptions.js:38:16)
at new NoProviderError (/home/ralf/git/angular2-renderer-example/node_modules/angular2/src/core/di/exceptions.js:74:16)
at Injector._throwOrNull (/home/ralf/git/angular2-renderer-example/node_modules/angular2/src/core/di/injector.js:854:19)
at Injector._getByKeyDefault (/home/ralf/git/angular2-renderer-example/node_modules/angular2/src/core/di/injector.js:905:21)
at Injector._getByKey (/home/ralf/git/angular2-renderer-example/node_modules/angular2/src/core/di/injector.js:845:25)
at Injector._getByDependency (/home/ralf/git/angular2-renderer-example/node_modules/angular2/src/core/di/injector.js:831:25)
at Injector._instantiate (/home/ralf/git/angular2-renderer-example/node_modules/angular2/src/core/di/injector.js:723:36)
at Injector._instantiateProvider (/home/ralf/git/angular2-renderer-example/node_modules/angular2/src/core/di/injector.js:714:25)
at Injector._new (/home/ralf/git/angular2-renderer-example/node_modules/angular2/src/core/di/injector.js:703:21)
Не могли бы вы помочь мне разобраться в этом? Как я могу определить, какой провайдер отсутствует?
Обновление 2: Оказалось, что реализация XHR отсутствует. Adding a shim исправил проблему. Теперь он работает.
Hi @ralfstx, у вас был шанс получить это обновление до ng4 +? –
@ChrisTarasovs нет, я в конце концов отказался от использования углового. Сожалею. – ralfstx