# angular **Repository Path**: zhtt/angular ## Basic Information - **Project Name**: angular - **Description**: No description available - **Primary Language**: NodeJS - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-05-29 - **Last Updated**: 2025-09-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## api https://angular.cn/api/forms/FormGroup#patchvalue ## 创建项目 ng new app13-bootstrap --style less --routing ## 导入方式 ``` import request = require('request'); ``` * webpack https://blog.csdn.net/More_Action/article/details/112966680 # angular6 执行 pull #### 代码高亮显示 [https://www.npmjs.com/package/angular2-highlight-js](https://www.npmjs.com/package/angular2-highlight-js) 1. 引入css、js ``` ``` 2. 安装 ``` npm install --save angular2-highlight-js ``` 3. 在app.module.ts中导入 ``` @NgModule({ imports: [ HighlightJsModule, ], providers: [ HighlightJsService ] }) ``` 4. 在需要高亮显示代码的component.ts中 ``` export class DemoComponent implements OnInit, AfterViewInit { constructor(private el: ElementRef, private service : HighlightJsService) {} ngAfterViewInit() { this.service.highlight(this.el.nativeElement.querySelector('.typescript')); } } ``` #### 使用说明 1. easui文件修改 * app02easyui\node_modules\ng-easyui\components\messager\messager.service.d.ts * import {Subject} from "rxjs"; * import {Subject} from 'rxjs/Subject'; 2. xxxx 3. xxxx #### 创建echarts项目 *参考地址 *https://www.cnblogs.com/timetimetime/p/9106182.html 1. ng new app06echarts * 不能在angular项目中 * 如果是win10环境,需要能管理员身份启动项目 2. 安装echarts npm包 * npm install echarts --save * npm install ngx-echarts --save 3. 在app.module.ts中导入NgxEchartsModule ``` import {NgxEchartsModule} from 'ngx-echarts'; imports: [ BrowserModule, NgxEchartsModule ], ``` 4. 异常:request has been blocked; the content must be served over HTTPS. 将请求修改为https方式 ## primeng [https://www.primefaces.org/primeng/#/](https://www.primefaces.org/primeng/#/) [https://github.com/primefaces/primefaces-designer-trial/blob/master/readme.txt](https://github.com/primefaces/primefaces-designer-trial/blob/master/readme.txt) # 报错 1. This command can not be run inside of a CLI project. 原因:位于一个angular项目中,执行创建项目命令 2. angular编译 报错 JavaScript heap out of memory [https://blog.csdn.net/Allan_shore_ma/article/details/78434698](https://blog.csdn.net/Allan_shore_ma/article/details/78434698) ``` node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve ``` ``` git clone git@gitee.com:zhtt/angular.git cd angular git remote rm origin git remote add origin https://gitee.com/zhtt/angular.git git pull git branch --set-upstream-to=origin/master master npm config set registry https://registry.npmmirror.com/ npm i ```