I updated my angular to v9 and when I try to go back in v8, I receive this error. I have already tried the following:
This error continues to show.
My stacktrace is :
An unhandled exception occurred: Job name "..getProjectMetadata" does not exist.
See angular-errors.log for further details.
Run Code Online (Sandbox Code Playgroud)
angular-errors.log :
[error] Error: Job name "..getProjectMetadata" does not exist.
at Observable._subscribe (/Front/node_modules/@angular-devkit/core/src/experimental/jobs/simple-scheduler.js:350:23)
at Observable._trySubscribe …Run Code Online (Sandbox Code Playgroud) 我应该如何配置新的Angular 8视图子级?
@ViewChild('searchText', {read: ElementRef, static: false})
public searchTextInput: ElementRef;
Run Code Online (Sandbox Code Playgroud)
与
@ViewChild('searchText', {read: ElementRef, static: true})
public searchTextInput: ElementRef;
Run Code Online (Sandbox Code Playgroud)
哪个更好?什么时候应该使用static:truevs static:false?
我有一个JSON如下所示的文件:
{
"primaryBright": "#2DC6FB",
"primaryMain": "#05B4F0",
"primaryDarker": "#04A1D7",
"primaryDarkest": "#048FBE",
"secondaryBright": "#4CD2C0",
"secondaryMain": "#00BFA5",
"secondaryDarker": "#009884",
"secondaryDarkest": "#007F6E",
"tertiaryMain": "#FA555A",
"tertiaryDarker": "#F93C42",
"tertiaryDarkest": "#F9232A",
"darkGrey": "#333333",
"lightGrey": "#777777"
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试将其导入到.tsx文件中.为此,我将其添加到类型定义中:
declare module "*.json" {
const value: any;
export default value;
}
Run Code Online (Sandbox Code Playgroud)
而我正在这样导入它.
import colors = require('../colors.json')
该文件中,我使用的颜色primaryMain作为colors.primaryMain.但是我得到一个错误 - JSON
我究竟做错了什么?
当我将Angular从7更新到Angular 8时,出现延迟加载模块错误
我尝试了角度升级指南中提供的选项
进行了以下更改:
之前
loadChildren: '../feature/path/sample-
tage.module#SameTagModule'
Run Code Online (Sandbox Code Playgroud)
后
loadChildren: () => import('../feature/path/sample-
tags.module').then(m => m.CreateLinksModule)
Run Code Online (Sandbox Code Playgroud)
错误TS1323:仅当'--module'标志为'commonjs'或'esNext'时,才支持动态导入。
我正面临一个异常ng build(为差异加载生成 ES5 包......)
An unhandled exception occured: Call retires were exceeded
Run Code Online (Sandbox Code Playgroud)
使用过的版本:
8.3.208.2.7 12.12.1 同样在日志中,它被提到
[error] Error: Call retries were exceeded at ChildProcessWorker.initialize
Run Code Online (Sandbox Code Playgroud) 当我使用Angular CLI(8.0.0)生成项目时,运行ng serve,在Internet Explorer中打开应用程序,然后出现空白屏幕。
我看了看polyfills.ts文件,并取消了以下几行的注释:
import 'classlist.js';
import 'web-animations-js';
Run Code Online (Sandbox Code Playgroud)
我也删除了所有core.js导入,因为Angular 8直接支持core.js 3.0。
我也跑了npm i。
package.json:
"dependencies": {
"@angular/animations": "~8.0.0",
"@angular/common": "~8.0.0",
"@angular/compiler": "~8.0.0",
"@angular/core": "~8.0.0",
"@angular/forms": "~8.0.0",
"@angular/platform-browser": "~8.0.0",
"@angular/platform-browser-dynamic": "~8.0.0",
"@angular/router": "~8.0.0",
"classlist.js": "^1.1.20150312",
"rxjs": "~6.4.0",
"tslib": "^1.9.0",
"web-animations-js": "^2.3.1",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.800.0",
"@angular/cli": "~8.0.0",
"@angular/compiler-cli": "~8.0.0",
"@angular/language-service": "~8.0.0",
"@types/node": "~8.9.4",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1", …Run Code Online (Sandbox Code Playgroud) 我已经将一个 Angular 项目从版本 7 更新到了 8。一切运行顺利,原理图完成了它的工作(也许),我们还好(项目甚至在生产中)。当我们更新 Angular CLI 时,我们总是会生成一个新项目来查看真正的差异并从中学习,例如新的依赖项、配置等。
使用 Angular CLI 8.0.4 生成新的 Angular 项目时,新应用程序没有core-js依赖项:
"dependencies": {
"@angular/animations": "~8.0.1",
"@angular/common": "~8.0.1",
"@angular/compiler": "~8.0.1",
"@angular/core": "~8.0.1",
"@angular/forms": "~8.0.1",
"@angular/platform-browser": "~8.0.1",
"@angular/platform-browser-dynamic": "~8.0.1",
"@angular/router": "~8.0.1",
"rxjs": "~6.4.0",
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
}
Run Code Online (Sandbox Code Playgroud)
core-js不存在对构建项目的分析包:
在我使用 Angular CLI 更新的旧项目中,core-js是否存在并且存在于最终包中:
"dependencies": {
"@angular/animations": "~8.0.3",
"@angular/cdk": "~8.0.1",
"@angular/common": "~8.0.3",
"@angular/compiler": "~8.0.3",
"@angular/core": "~8.0.3",
"@angular/forms": "~8.0.3",
"@angular/platform-browser": "~8.0.3",
"@angular/platform-browser-dynamic": "~8.0.3",
"@angular/router": "~8.0.3",
"@auth0/angular-jwt": "2.1.1",
"@hackages/ngxerrors": "~8.0.0",
"@ng-bootstrap/ng-bootstrap": "5.0.0-rc.1",
"@ngx-loading-bar/core": …Run Code Online (Sandbox Code Playgroud) 我正在使用ViewChild,如下所示:
@ViewChild("InternalMedia") localStream;
@ViewChild("emoji") mEmoji;
Run Code Online (Sandbox Code Playgroud)
一直工作到angular-7.x
我将其升级到angular-8.x后,就开始出现以下错误
.../call_emoji/component.ts(41,4): error TS2554: Expected 2 arguments, but got 1.
Run Code Online (Sandbox Code Playgroud)
我检查了https://angular.io/api/core/ViewChild,并将其更改为
@ViewChild("InternalMedia",{static:false}) remoteStream;
Run Code Online (Sandbox Code Playgroud)
有用。我没有得到什么静态效果,像以前一样工作应该有什么价值?
将 Angular 8 项目更新为 Angular 9 时,出现错误
\n\xe2\x9c\x94 Package successfully installed.\nUsing package manager: 'npm'\nCollecting installed dependencies...\nFound 0 dependencies.\nPackage '@angular/core' is not a dependency.\nRun Code Online (Sandbox Code Playgroud)\n我使用的命令
\nng update @angular/core@9 @angular/cli@9 --force\nRun Code Online (Sandbox Code Playgroud)\n 错误
储存库不干净。请先提交或存储任何更改,然后再进行更新
当我从版本7更新到Angular 8时。
Angular升级指南https://update.angular.io/#7.0:8.0
D:\app-test> ng update @angular/cli @angular/core
npm cache verify
Run Code Online (Sandbox Code Playgroud)
储存库不干净。请在更新之前提交或存储任何更改。
更新版本
PS D:\app-test> ng update
Using package manager: 'npm'
Collecting installed dependencies...
Found 58 dependencies.
We analyzed your package.json, there are some packages to update:
Name Version Command to update
--------------------------------------------------------------------------------
@angular/cdk 7.2.2 -> 8.0.1 ng update @angular/cdk
@angular/core 7.2.15 -> 8.0.1 ng update @angular/core
@angular/core 7.2.2 -> 7.2.15 ng update @angular/core
@angular/material 7.3.7 -> 8.0.1 ng update @angular/material
rxjs 6.3.3 -> 6.5.2 ng update …Run Code Online (Sandbox Code Playgroud) angular ×10
angular8 ×10
typescript ×5
angular-cli ×4
angular9 ×2
npm ×2
viewchild ×2
angular7 ×1
git ×1
javascript ×1
json ×1
module ×1
ng-build ×1
polyfills ×1