编写Chrome插件将googleapis替换为国内可访问的CDN

编写Chrome插件将googleapis替换为国内可访问的CDN

由于公司不能安装梯子,所以不能访问谷歌商店,平时频繁地要访问国外的AngularJS网站,比如AgGrid,AngularJS Material,AngularJS官网等,很多用了Google的CDN源,页面就无法正常加载。

一开始的思路是改host文件,但是我们没有Google CDN的证书,会造成证书错误。

参考并优化了:https://github.com/justjavac/ReplaceGoogleCDN ,动手写了一个Chrome插件,对所有特定请求重定向,解决痛点!

阅读更多
Make simple <md-chip> work without <md-chips> in AngularJS Material?

Make simple <md-chip> work without <md-chips> in AngularJS Material?

I’m using AngularJS Material v1.1.1.
I’m finding a way to use simple <md-chip> without <md-chips>.

Here is an easy way in Vue Material: https://codesandbox.io/s/lyoqv4l0z?module=App.vue

1
<md-chip class="md-primary" md-deletable>Deletable</md-chip>

But I can not find the similiar way in AngularJS Material document.
https://material.angularjs.org/latest/api/directive/mdChip

阅读更多

ChartJS鼠标移到图例上显示手形

在Chart options中添加:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// 给图例加手势
legend: {
onHover: function(e) {
e.target.style.cursor = 'pointer';
}
},

// 给图加手势
hover: {
onHover: function(e) {
var point = this.getElementAtEvent(e);
if (point.length) {
e.target.style.cursor = 'pointer';
} else {
e.target.style.cursor = 'default';
}
}
}