摘要: 1. 卸载当前版本 npm uninstall g angular cli 2. 清除未卸载干净的angular cli缓存 npm cache clean f 3. 到安装目录查看是否卸载干净 find /usr name ng 4. 若未卸载干净(第三步有内容输出),则去到对应的目录删除;如若卸 阅读全文
posted @ 2019-02-23 09:49 Zero_追梦 阅读(9349) 评论(1) 推荐(0) 编辑
摘要: 说明: 组件使用了ng zorro (https://ng.ant.design/docs/introduce/zh) 第一类:嵌套表单 1. 静态表单嵌套 demo.component.html demo.component.ts 2. 动态表单嵌套 (数组式添加) 1. demo.compone 阅读全文
posted @ 2019-02-23 09:29 Zero_追梦 阅读(4369) 评论(0) 推荐(0) 编辑
摘要: 问题一、 iframe如何自适应屏幕高度 解决思路:通过设置iframe外层父元素高度等于window高度,再相对于父元素定位iframe元素;案例如下: 第一步: 模板文件中使用iframe 第二步: ts 中自定义iframe外层父元素的高度 问题二、 安全机制设置 错误: 解决: 第一步:创建 阅读全文
posted @ 2019-01-19 09:54 Zero_追梦 阅读(3201) 评论(0) 推荐(0) 编辑
摘要: 更多JS实战记录,请前往:https://www.yuque.com/smallwhy/yyvuqy 1. 时间字符串格式 var dateString1 = '2016-06-15 10:22:00'; var dateString2 = '2016/06/15 10:22:00'; var da 阅读全文
posted @ 2019-01-05 10:29 Zero_追梦 阅读(10585) 评论(0) 推荐(0) 编辑
摘要: 用于进入组件前的加载动画 第一步:index.html 定义动画模板和样式 第二步:路由守卫,在进入路由满足条件时取消加载 请求登陆认证接口,已登录 取消加载,进入路由;未登录 跳转至登录页,无需取消加载 加载效果预览 阅读全文
posted @ 2019-01-01 10:29 Zero_追梦 阅读(1301) 评论(0) 推荐(0) 编辑
摘要: 管道的作用就是将原始值进行转化处理,转换为所需要的值; 1. 新建sex reform.pipe.ts文件 2. 编辑sex reform.pipe.ts文件 3. 使用demo组件中使用自定义管道 同@Component({})和@NgModel({})一样,@Pipe({})代表这是一个管道,里 阅读全文
posted @ 2019-01-01 10:20 Zero_追梦 阅读(3246) 评论(0) 推荐(1) 编辑
摘要: 1. 安装ng2 codemirror包、codemirror包 2. 在所需要使用codemirror组件的模块中引入CodeMirror模块 3. 在组件html模板文件中使用codemirror组件 4. 在组件ts文件中定义codemirror组件所需要的变量; 和引入codemirror组 阅读全文
posted @ 2018-12-31 12:07 Zero_追梦 阅读(4739) 评论(1) 推荐(2) 编辑
摘要: 目的:实现前后端分离,前端减少路径请求的所需的路由文件; 第一步:安装http代理中间件 第二步: express文件中(app.js)配置反向代理 解析:本地的请求地址是localhost:5000/login,当经过代理配置后,会将localhost:5000替换为http://192.166. 阅读全文
posted @ 2018-11-25 09:45 Zero_追梦 阅读(3690) 评论(0) 推荐(0) 编辑
摘要: 更多JS实战记录,请前往:https://www.yuque.com/smallwhy/yyvuqy JS // 禁用超链接元素elem ; document.getElementById(elemID).setAttribute('disabled', 'disabled'); // 启用超链接元 阅读全文
posted @ 2018-11-25 09:41 Zero_追梦 阅读(3538) 评论(0) 推荐(0) 编辑
摘要: 1. 安装echarts包、ngx echarts包 2. angular.json中引入echarts.js文件 3. 根模块中导入NgxEchartsModule模块 4. 组件中使用echarts图表 (1). HTML test.component.html (2). TS test.com 阅读全文
posted @ 2018-11-25 09:28 Zero_追梦 阅读(7927) 评论(0) 推荐(0) 编辑