自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(27)
  • 收藏
  • 关注

原创 react 报错

常见安装的错误,解决办法:cnpm i

2019-04-15 14:35:46 238

原创 Fri Sep 28 2018 00:00:00 GMT+0800 (中国标准时间) {} 时间格式转换

Fri Sep 28 2018 00:00:00 GMT+0800 (中国标准时间) {}  转换为  2018-09-28 00:00:00parseTime(d: any) { const newDate = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' ...

2018-07-31 15:35:32 24957

转载 angular 中引入 easyUI

参照 easyUI 官网:http://www.jeasyui.com/documentation2/index.php之后报错:Error: Can't resolve 'rxjs/Subject' in 'F:\ecuador-demo\node_modules\ng-easyui\components\messager'解决办法: import{Subject}from...

2018-07-30 16:07:24 1633

原创 primeNG__datatable

使用注意:1. 单选多选表格, <p-table> 不可添加 dataKey="vin",否则选中样式为所有行;2. 表格宽度随内容适应,<p-table> 添加 autoLayout="true";3. 后台得到的数据需要映射,通过自定义管道实现,遍历数据找到该项;...

2018-07-26 08:40:13 1041

转载 please specify path to 'tslint' package correctly

解决办法:webstorm配置tslint参考:https://blog.csdn.net/zhumengzj/article/details/79041787

2018-07-06 09:34:38 2705

原创 ERROR in No NgModule metadata found for 'AppModule'.

解决办法:在AppModule中随便删除一行

2018-07-06 09:03:47 2124

原创 angular项目中用到的主要技术

平滑滚动条  MalihuScrollbarhttps://github.com/jfcere/ngx-malihu-scrollbar百度地图  Angular2-baidu-maphttps://leftstick.github.io/angular2-baidu-map/#/quickstart高德地图 ngx-amaphttps://xieziyu.github.io/ngx-amap/#...

2018-06-28 09:42:51 1101

原创 Could not find module "@angular-devkit/build-angular"

报错:Could not find module "@angular-devkit/build-angular"解决办法:npm i --save-dev @angular-devkit/build-angular

2018-06-25 17:27:46 11362 7

原创 通过调试工具 查找 登录提交的接口

通过调试工具 查找 登录提交的接口:输入错误的账户密码点击登录按钮F12 > network> all 

2018-06-05 10:06:11 2439 1

原创 元数据版本不匹配 报错

报错:ERROR in Metadata version mismatch for module /node_modules/angular2-cool-storage/index.d.ts, found version 4, expected 3,原因: 暂时未知解决办法:在app.rouring.module.ts 随便打几个空格,重新编译即可参考:https://blog.csdn.net/...

2018-05-29 09:56:37 1749 1

原创 app模块引入BrowserAnimationsModule 报错

原因:没有安装@angular/animations模块解决办法:npm install @angular/animations@latest --save

2018-05-28 17:53:31 1006

原创 获取数据时过滤数据

1. 关键字传参:写法简单,但是获取不同的数据时,需要多次从服务器发出请求;2. 管道:需要自定义管道,判断是否包含该字段,返回包含该字段的数据,写着麻烦,但是之后调用方便,所以不同管道到底是取了一次数据还是多次?...

2018-05-07 11:42:21 950

转载 公用组件

想要定义一个公共模块,然后模块里面有一堆公用组件,这些组件可以在任意其他模块使用,那么这种情况下,你定义的公共模块必须要导出( exports )你所有隶属于这个模块的公共组件,在其他模块使用的时候不用导入这些公共组件,只需要导入公共模块即可...

2018-04-27 13:36:37 1006

原创 Angular4中回调函数内数据绑定无法及时更新

解决办法:1. 导入 ChangeDetectorRef :import { ChangeDetectorRef } from '@angular/core'; constructor( private changeDetectorRef: ChangeDetectorRef) { }2. 回调函数内,获得数据后:this.changeDetectorRef.markForCheck();...

2018-04-27 09:33:00 1542 3

原创 TypeError: Cannot read property 'valid' of undefined

控制台报错:TypeError: Cannot read property 'valid' of undefined编辑器提示:解决办法:添加方法获取nameget name() { return this.heroForm.get('name');}

2018-04-25 11:07:33 1344

转载 Angular 报错

 Can't bind to 'formGroup' since it isn't a known property of 'form'所在模块已经引入了 FormsModule ,ReactiveFormsModule 解决办法:在app.module.ts中引入FormsModule ,ReactiveFormsModule...

2018-04-24 14:38:15 277

原创 内存 Web API(In-memory Web API) 模拟多个远程数据

内存 Web API(In-memory Web API) 模拟多个远程数据时,app.module中1. 引入数据服务:import { ClientsDataService } from './clients-data.service';import { InMemoryDataService } from './org-data.service';2. imports:HttpClient...

2018-04-10 16:24:21 1479 1

原创 【bug】TypeError: undefined is not a function

控制台报错:TypeError: undefined is not a function可能是因为调用的函数未定义,但是都定义了解决办法:重新启动 ng serve 即可

2018-04-10 10:44:05 1094

原创 【坑】新建组件报错

F:\samples>ng g c add-sampleError: More than one module matches. Use skip-import option to skip importing the component into the closest module.More than one module matches. Use skip-import option ...

2018-04-02 16:21:12 3664

原创 【Angular】路由router

1. 新建路由模块ng generate module app-routing --flat --module=app--flat                     生成在src/app--module=app      配置到app模块2. 引入所需组件import { HeroesComponent } from './heroes/heroes.component';import { ...

2018-04-02 11:58:11 335

原创 【Angular】组件之间通讯 Input & Output

Input  【 父组件向子组件传入数据 】父组件:1.  准备数据(或引入服务中获取数据)import { Hero } from '../hero';                                   // 定义类型import { HEROES } from '../mock-hero';                    // json数据heroes = HEROE...

2018-04-02 10:31:28 216

原创 【Angular】服务 Service

一. 创建服务1. 新建服务 ng generate service ... --module=app //创建该服务并注入配置到app.module2. 设置该服务的方法eg:   debug(msg: string){            console.log(msg);          }二. 组件使用该服务1. 引入服务import { LoggerService } from '....

2018-03-29 09:08:20 669

原创 【坑】angular官方教程Http获取不到数据

安装的最新版本为0.6.0 , 一直获取不到数据;解决办法:安装版本为0.5.0npm install angular-in-memory-web-api@0.5.0--------------------------------------------------------------------------------------http.get请求后台数据 , npm运行成功 ,但是并没有...

2018-03-28 15:34:21 1268

转载 【Angular】MVVM设计模式

MVVM(Model-View-ViewModel)MVVM框架是MVP模式与WPF结合的一种新型架构框架。MVC  & MVP相似点:Controller/Presenter负责逻辑的处理,Model提供数 据,View负责显示。二者区别:MVC:View直接从Model中读取数据。MVP:View不直接使用Model,通过 Presenter (MVC中的Controller)来进行交...

2018-03-28 13:56:36 602

原创 【Angular】数据绑定的方法

1. 插值{{ greeting  }}   greeting = "     " ;2. 属性绑定[ value ] = " string / 表达式 "3. 事件绑定(click)= " myclick( ) "4. 双向绑定[( ngModel )] = "  myData "即 属性绑定 +事件绑定,记住 ' 盒子里的香蕉 ';双向数据绑定是MVVM设计模式中的显著特征;...

2018-03-28 13:51:00 203

原创 【坑】使用 RxJS 的 of() 函数来模拟从服务器返回数据

服务中引入 RxJS:import { Observable, of } from 'rxjs';//官方文档中的写法 出现报错 /heroes/node_modules/rxjs/Rx"' has no exported member 'of'.解决办法:import { Observable } from 'rxjs/Observable';import { of } from 'rxjs/o...

2018-03-28 12:03:55 1818

原创 【Angular】angular CLI 命令

angular CLI 命令:ng new 项目名ng generate component 组件名( 默认情况下,生成的组件会带有模板文件,你可以通过参数覆盖它:ng generate component 组件名 -it)ng generate class hero  【 hero.ts 】ng generate service 服务名ng generate module 路由模块名 --fla...

2018-03-28 11:55:14 231

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除