随笔分类 - Angular
摘要:angular中使用jquery的步骤: 第一步:安装jquery npm install --save jquery1第二步:安装jQuery的声明文件 npm install @types/jquery --save1第三步:检查安装是否成功 前两步成功的话,会在package.json文件中多
阅读全文
摘要:1.先升级Angular版本到指定版本,不能跨级升级。 ng update @angular/cli@7.2.0 cnpm install npm install ng-zorro-antd@0.7.0
阅读全文
摘要:1.在index.html中加入: <base href="/"> 2.在 app.module.ts 中替换: import {APP_BASE_HREF} from "@angular/common"; // { provide: LocationStrategy, useClass: Hash
阅读全文
摘要:PS E:\MyProject\AllManger\publicMobile> ng build✔ Browser application bundle generation complete.✔ Copying assets complete.✖ Index html generation fai
阅读全文
摘要:1.使用命令行创建新项目的时候遇到的错误:Your global Angular CLI version (6.0.8) is greater than your localversion (1.7.4). The local Angular CLI version is used.翻译过来就是:使
阅读全文
摘要:1、ngOnChanges - 当数据绑定输入属性的值发生变化时调用 2、ngOnInit - 在第一次 ngOnChanges 后调用 3、ngDoCheck - 自定义的方法,用于检测和处理值的改变 4、ngAfterContentInit - 在组件内容初始化之后调用 5、ngAfterCon
阅读全文
摘要:参考和体验地址: 开发文档:https://hacpai.com/article/1549638745630 体验地址:https://hacpai.com/guide/markdown Angular中使用: 1.安装依赖: npm install vditor --save 2.在代码中引入并初
阅读全文
摘要:手动更改: 在 src 目录下建立一个单独的 theme.less 文件,在 angular.json 文件的 styles 列表加入该文件 ... "styles": [ ... "src/theme.less" ... ] ... 在样例中通过修改 @primary-color 的数值将 ng-
阅读全文
摘要:$ ng new PROJECT_NAME $ cd PROJECT_NAME $ ng add ng-zorro-antd 上面的命令尽量在cmd下执行, 参考教学视频:https://ninghao.net/video/7567
阅读全文
摘要:1.如果版本安装错误 1.1 npm uninstall -g @angular/cli 卸载之前的版本1.2 npm cache verify 清理缓存,确保卸载干净1.3 ng v ,若显示类似command not found的信息,则说明卸载完成 2.cnpm install -g @ang
阅读全文
摘要:原文地址:https://blog.csdn.net/xf1195718067/article/details/78724845 为了弄懂angular的动画自己也是花了一番功夫,不客观的说,angular的动画写起来是比较复杂的,但又必须掌握。 下面是我结合官方文档的资料,自己通过实践写出来的一篇
阅读全文
摘要:1.卸载之前的版本 npm uninstall -g @angular/cli 2.清除缓存,确保卸载干净 npm cache clean --force 3.检查是否卸载干净 输入命令 ng -v 若显示command not found则卸载干净 4.安装指定版本 npm install -g
阅读全文
摘要:创建Angular的脚手架 1.在全局安装Angular脚手架环境(安过就不用在安了) npm install -g @angular/cli 2.在本地文件夹中创建angular项目(找好要安装到那个目录中,在那个目录下cmd) 3.进入项目 启动项目 npm start 或者 ng serve(
阅读全文
摘要:原文地址:https://www.cnblogs.com/sghy/p/9111293.html angular2、angular4、angular5 及以上版本的跨域问题。 通过angular自身的代理转发功能 配置package.json 两种方式启动代理服务 第一种: 启动项目通过npm st
阅读全文
摘要:ng build --prod --build--optimizer
阅读全文
摘要:原文:https://blog.csdn.net/qq_35321405/article/details/80244047 第一步:创建路由文件 ng generate module app-routing --flat --module=app 注释:--flat 把这个文件放进了 src/app
阅读全文
摘要:ng-zorro-antd博客:https://www.jianshu.com/p/1f348806a146 真具体步骤: ng new 项目名 cd 项目文件夹 npm install ng-zorro-antd --save ng add ng-zorro-antd
阅读全文
摘要:1.安装node node下载地址:https://nodejs.org/zh-cn/download/ node安装会默认装好npm 检验node,npm安装成功否 node -v npm -v2.安装淘宝镜像(cnpm) npm install cnpm -g --registry=https:
阅读全文
摘要:html: <h2>人员登记系统</h2> <div class="people_list"> <ul> <li>姓名:<input type="text" [(ngModel)]="peopleInfo.username" class="form_input" /></li> <li> 性别: <
阅读全文
摘要:1.命令创建项目,不按照依赖: ng new angualrdemo08 --skip-install安装依赖:cnpm install 2. 创建需要的组件 ng g component home ng g component news ng g component newscontent 3.
阅读全文