报错: Module 'App' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. 解决办法: angular.module('bookxApp').controller(...) ; 少了依赖 [ ] 双括号 改成…
1.错误信息: Failed to instantiate module app due to: Error: [$injector:unpr] http://errors.angularjs.org/1.5.8/$injector/unpr?p0=showE... at http://localhost:6664/hospital/assets/js/angular.min.js?v=1499753083736:6:412 at http://localhost:6664/hospital/a…
目录1 json的key...value问题 遍历json的key...value的时候报错: [tslint] for (... in ...) statements must be filtered with an if statement 原代码: for (let key in this.targetList[0]) { this.tableHeaders.push({ value: key, name: key }) } 修改为: for (const key in Object.ke…
错误描述 当form表单加FormGroup属性时报错 Can't bind to 'formGroup' since it isn't a known property of 'form' <form nz-form [formGroup]="valForm" (ngSubmit)="submit()" role="form"> <div nz-form-item> <div nz-form-control [nz…
安装 Angular CLI 命令: sudo npm install -g @angular/cli 打印如下错误:(权限问题) gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/用户名/.node-gyp/10.15.3" 问题解决:添加 --unsafe-perm 参数,npm 会有生命周期,某个包会有生命周期来执行一些东西,安全起见会自动降级导…
Mac Angular打包报错: Error: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance Angular项目运行,打包需安装环境如下: 1:安装node(自己去官网下载指定版本安装,Angular1.0这种过时的项目是不支持高版…
之前为了熟悉流程一直都是手动创建组件,今天试着用cli创建组件,居然报错了,报错大致为: Unexpected token / in JSON at position.... ,并且错误指向了.angular-cli.json文件.查阅资料发现因为这个json文件中有注释,就报错了.解决方案就是把注释删掉ok了. 用cli创建组件确实很方便,相关的html.css等文件都自动创建好了.…
报错信息: ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'null: 8'. Current value: 'null: 4'. 报错触发: 在渲染时,连续多次修改Expression ,出现该问题 报错原因:Angualr中的change detection strategy,大概意思是在变更检测之后时…