我有一个问题。
我正在尝试使用ng-cli创建一个Angular 8库,但是我无法通过npm link
保留来自外部应用程序的符号链接。
我尝试在我的angular.json文件中添加以下内容:
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"preserveSymlinks": true,
"tsConfig": "projects/button/tsconfig.lib.json",
"project": "projects/button/ng-package.json"
}
},
但是得到了:
"Schema validation failed with the following errors: Data path ""
should NOT have additional properties(preserveSymlinks)."
我发现它对于库并没有起作用。
然后我尝试将这个添加到我的tsconfig.lib.json文件中:
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"preserveSymlinks": true
}
什么也没有发生。
我在这里寻找解决方案,但没有找到类似的内容。
我该如何做呢?
谢谢!
"preserveSymlinks": true
,会有什么区别吗? - R. RichardsNgBradButtonComponent.html:2 ERROR NullInjectorError: StaticInjectorError(AppModule)[NgClassImpl -> ElementRef]: StaticInjectorError(Platform: core)[NgClassImpl -> ElementRef]:
原因是我的组件具有_ngClass_和_ngIf_。我不知道这是否是正确的方法。 - andersonbalves