我有一个9角库,我想推到注册表。
当我运行ng build <my-lib>时,它的构建是正确的,但是它抱怨Ivy:
******************************************************************************
It is not recommended to publish Ivy libraries to NPM repositories.
Read more here: https://v9.angular.io/guide/ivy#maintaining-library-compatibility
******
打开一个全新的项目,绝对没有任何改变,当我服务该项目时,会出现以下错误:
Error: node_modules/@angular/platform-browser/platform-browser.d.ts:44:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule
class.
This likely means that the library (@angular/platform-browser) which declares
我已经从Angular 8升级到了9,并按照的所有步骤启用了Ivy。当我运行npm install时,我的几个包抛出了错误:
Tried to overwrite <package_path>.__ivy_ngcc_bak with an ngcc back up file, which is disallowed。
这意味着什么?为什么会发生这种情况?我很难找到关于它的任何信息。我已经安装了所有这些包的最新版本,抛出了这个错误,但是当我运行npm install时仍然得到这个错误。谢谢!
我最近决定将我的ionic项目从4更新到5,并计算出当我在它的时候,我会从Angular 8更新到9。
一切都很顺利,应用程序运行正常,直到我尝试运行我的单元测试。我被这个错误轰炸了,我不知道为什么。我怀疑这与路由器有关,但我甚至不能确认。
Error: This constructor was not compatible with Dependency Injection.
Error: This constructor was not compatible with Dependency Injection.
at Module.ɵɵinvalidFactory (http://
我正在尝试创建模式窗口的指令组件,它负责模式行为,如打开,关闭,照顾zIndex等。
模态组件的内容由Controller控制。到目前为止,想法是好的,但当我尝试
<modal ng-controller="MyController">
Some content which will be transcluded with dynamic {{value}} from MyController
</modal>
它失败了,并且没有呈现{{value}},我必须将模式包装到控制器中
<div ng-controller="MyContro
我有一个角组件,作为其他组件的正面。这是使用ComponentFactoryResolver实现的。当我将管道引入其中一个生成的组件时,我的单元测试开始以一种奇怪的方式失败。
,我希望有人能解释为什么会这样失败?
Failed: NG0302: The pipe 'displayValue' could not be found!. Find more at https://angular.io/errors/NG0302
error properties: Object({ code: '302' })
Erro
当我尝试执行ng build时,我得到一个错误消息: ERROR in node_modules/@angular/common/http/http.d.ts:81:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.
This likely means that the library (@angular/common/http) which declares HttpClient has not been proce
我将我的angular应用程序从8升级到9,并启用了Ivy。现在应用程序正在正确构建,但是当我执行ng服务时,我在控制台中得到了一个错误- Error: inject() must be called from an injection context
at injectInjectorOnly (VM29 vendor.js:32922)
at Module.ɵɵinject (VM29 vendor.js:32933)
at Object.A11yModule_Factory [as factory] (VM29 vendor.js:8401)
at R3
我将我的angular 8.x.x项目迁移到angular 9.x.x,当我试图发布库时,它失败了,出现了以下错误
npm ERR!@候选人/网站@9.0.0 prepublishOnly:node --eval "console.error('ERROR: Trying to publish a package that has been compiled by Ivy. This is not allowed.\nPlease delete and rebuild the package, without compiling with Ivy, before attemp
我编写了一个实现来从API调用中获取数据。但是,在测试功能时,甚至在编写任何有意义的测试用例之前,我都会得到以下错误:
TypeError: Cannot read property 'subscribe' of undefined
at DataComponent.ngOnInit (http://localhost:9876/_karma_webpack_/webpack:/src/app/dashboard/job/job.component.ts:48:10)
at callHook (http://localhost:9876/_karma_webpa
当我尝试使用Ivy在Angular 8应用程序中导入ag grid模块时,我得到了以下错误。 ERROR in There is no format with import statements in 'path_to_node_modules/node_modules/ag-grid-angular' entry-point. 如果我禁用了Ivy,这个错误就会消失。有谁知道解决办法吗? 包版本: "ag-grid-angular": "^21.0.0",
"ag-grid-community": "^21.0.0&
我有棱角的形状。
当我打开应用程序时,控制台在没有我做任何事情的情况下登录in fooValidation四次。
in fooValidation
in fooValidation
in fooValidation
in fooValidation
为什么?这是设计出来的吗?如何使其仅在表单提交后或当焦点位于指定字段时执行?
import { Component } from "@angular/core";
import { FormGroup, FormControl } from '@angular/forms';
const fooValidation
当我尝试在我的AngularJS (1.6.10版)应用程序上执行gulp serve时,收到以下错误消息:
Error: [$injector:modulerr] Failed to instantiate module myAppName due to:
$compileProvider.preAssignBindingsEnabled is not a function
@http://localhost:9805/app/scripts/app.js:43:9
invoke@http://localhost:9805/lib/angular/angular.js:5108:16
run
我想启动一个angular项目,我已经安装了angular/cli,并且我已经用ng new mon-premier-projet创建了这个项目,但是当我启动服务ng serve时,我得到了这个错误 node_modules/@angular/router/router.d.ts:2631:22 - error NG6003: Appears in the NgModule.exports of AppRoutingModule, but could not be resolved to an NgModule, Component, Directive, or Pipe class.
T
我无法将新组件添加到本机脚本项目中,当我执行ng generate component faqs时,它返回错误:
Option "entryComponent" is deprecated: Since version 9.0.0 with Ivy, entryComponents is no longer necessary.
Cannot read property 'kind' of undefined
或者,如果我像ng generate component一样运行它,它会询问组件名称
? What name would you like to use
我使用的常春藤与角质材料,但当我运行ng build时,我有以下问题:
ERROR in Tried to overwrite D:/Subin/PROJECTS/angular-ivy-sample/node_modules/@angular/material/table/typings/table.d.ts.__ivy_ngcc_bak with an ngcc back up file, which is disallowed.
有什么办法解决吗?
我使用的是角8.0.0和角材料8.0.1。
我找到了一些有用的链接,但似乎没有解决办法:
我看到很多人发布关于NullInjectorError: No provider for HttpClient!的问题,但我在我的Karma单元测试中得到了一个更具描述性的错误。我一直在与Javascript/Typescript、HTML和CSS/SCSS并行学习Angular,所以我的基础有点不稳定。我如何修复这个错误?对于那些说是因为OP忘记导入测试模块的人,我已经导入了测试模块。下面是我的测试文件的样子。当我注释掉html中的所有内容时,仍然会收到这个错误。此外,我还尝试将ApiService存根。 错误: NullInjectorError: R3InjectorError(Dyn
我使用的角度材料谷歌地图组件,以集成地图到一个离子/电容应用程序。
在开发应用程序时,映射功能非常好。当我试图为实现Google的组件运行测试文件时,我会得到以下错误:
Failed: Namespace google not found, cannot construct embedded google map. Please install the Google Maps JavaScript API: https://developers.google.com/maps/documentation/javascript/tutorial#Loading_the_Maps_API
Err