- 博客(9)
- 收藏
- 关注
原创 failed: Error during WebSocket handshake: Unexpected response code: 400
问题描述:在项目中引用Socket.Io,在项目部署后报错,本地运行不报错错误原因:需要在配置文件nginx.conf中配置相关信息解决方案: 在nginx文件的location中添加 proxy_http_version 1.1; proxy_set_...
2018-08-09 16:10:30
7945
原创 Angular5到Angular6:Property 'map' does not exist on type 'Actions<Action>'. Property 'mergeMap' does
报错内容:Property 'map' does not exist on type 'Actions<Action>'.Property 'mergeMap' does not exist on type 'Actions<Action>'.错误原因:升级到Angular6后,这些方法在写法上做了调整解决方案:1.导入方式改变import {ma...
2018-08-03 12:32:39
994
原创 Angular5到Angular6:Property 'map' does not exist on type 'Observable<Response>'.
错误原因:angular6不再支持原来的Http,用HttpClient代替了原来的Http解决方案:1. importimport {Http, Headers, Response} from '@angular/http'; 改为=>import {HttpClient, HttpHeaders, HttpParams } from '@angular/comm...
2018-08-03 12:19:12
2618
原创 Angular5到Angular6:node_modules/rxjs/Observable"' has no exported member 'Observable'.
错误原因:angular6中导入Observable的路径改变解决方案:将import {Observable} from 'rxjs/Observable';改为:import {Observable} from 'rxjs';
2018-08-03 12:08:33
2888
2
转载 在Angular输入框内按下回车会触发其它button的点击事件的解决方法
将不需要触发事件的button上添加type="button"即可<button type="button" (click)="clickMe()">click</button>参考:https://stackoverflow.com/questions/20945834/why-hitting-enter-in-angularjs-forms-text-input-cau...
2018-06-20 10:50:06
1775
转载 angular 监听窗口滚动
转自:http://brianflove.com/2016/10/10/angular-2-window-scroll-event-using-hostlistenerimport { HostListener} from "@angular/core";@HostListener("window:scroll", [])onWindowScroll() { //we'll do some...
2018-04-24 10:31:42
4750
原创 Error: Cannot find module 'babel-runtime/regenerator'
问题描述:在做调用阿里云短信接口时遇到的一个问题错误原因:没有正确安装相应的module解决办法:第一步:在package.json中加入依赖label-runtime第二步:在Terminal中npm install --save...
2018-03-09 15:40:34
10480
2
原创 Angular 利用路由跳转到指定页面的指定位置
之前做过页面内的跳转,比较简单,最近项目需要实现跨页面跳转,并跳转到指定地点,试了很多方法,有用到传递参数然后让页面滚动相应的距离,但是一旦文章长短发生变化,滚动的距离也需要重新计算,比较麻烦,所以最后总结出这两种比较靠谱的方法,只需要在需要跳转的地方加上合适的id就行,原理和单页面内跳转相似。detail.component.html<p>You'll see which payme...
2018-03-07 15:16:19
13639
原创 卸载并安装指定版本Angular CLI
1.卸载之前的版本npm uninstall -g @angular/cli2.清除缓存,确保卸载干净npm cache clean --force3.检查是否卸载干净输入命令ng -v若显示command not found则卸载干净4.安装指定版本npm install -g @angular/cli@1.6.35.检查版本号ng -v效果如图所...
2018-01-15 12:05:00
20055
5
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人