首页 > 解决方案 > 为什么 Angular-Core 会抛出“无法解析 ApplicationModule 的所有参数”

问题描述

所以首先我知道有一些帖子,但我的问题似乎并不相关(尝试了一堆,甚至使用了一些)。我也是这个项目的新手,我以前没有做过这样的 Angular(所以请善待)

该项目的引导程序如...

@NgModule({
  imports: [
    ApplicationModule,
  ],
  ...
})

我的代码得到了这个 Angular 函数......

CompileMetadataResolver.prototype._getTypeMetadata = function (type, dependencies, throwOnUnknownDeps) {
    if (dependencies === void 0) { dependencies = null; }
    if (throwOnUnknownDeps === void 0) { throwOnUnknownDeps = true; }
    var identifier = this._getIdentifierMetadata(type);
    return {
        reference: identifier.reference,
        diDeps: this._getDependenciesMetadata(identifier.reference, dependencies, throwOnUnknownDeps),
        lifecycleHooks: getAllLifecycleHooks(this._reflector, identifier.reference),
    };
};

标识符是

reference: ƒ ApplicationModule(appRef)
arguments: (...)
caller: (...)
ɵinj: {providers: Array(9), imports: Array(0), factory: ƒ}
length: 1
name: "ApplicationModule"
prototype: {constructor: ƒ}
__annotations__: [DecoratorFactory]
__proto__: ƒ ()
[[FunctionLocation]]: core.js:30477
[[Scopes]]: Scopes[3]

就我所知,这是来自 Angular 核心库的 ApplicationModule,这意味着 Angular 本身正在失败。

为什么 Angular 会以这种方式导致我的应用程序失败?

标签: angular

解决方案


推荐阅读