第一個要介紹的是咱們的麻煩製造器:angular-ui-bootstrap
ui-bootstrap能夠有不少通用的插件給你們用,好比彈窗啊(modal),翻頁控件啊(pagination),爲何說它麻煩呢,由於它家官網被牆了,看不到文檔!可我就是要用啊,怎麼辦?老辦法,下載來再說:html
npm install --save-dev angular-ui-bootstrap
而後到mode_modules文件夾裏找到這傢伙,好比我要用pagination:node
\node_modules\angular-ui-bootstrap\src\pagination\docs\demo.html
每一個裏邊都有個例子文件,供你們學習使用,看了之後就知道怎麼用了。還有這個modal,網上都是這樣的代碼注入:$modal
,但是實際上demo裏的是這樣:$uibmodal
(血與淚的經驗,沒文檔好難過)。
第二個要介紹的是:highcharts
說一下怎麼在這裏用highcharts繪圖表:網上查了不少資料,首先:web
npm install highcharts-ng
用以在angular中做爲依賴引入:npm
var statisticModule = angular.module('statisticModule', [require('highcharts-ng')]);
而後就一直報這個Chart未定義的錯誤,搞了很久,原來意思是:這個highcharts-ng並非highcharts的主體,而是highcharts的一個插件而已,因此還要引入highcharts的主體,那好:bootstrap
npm install --sava-dev highcharts
而後代碼裏:svg
var statisticModule = angular.module('statisticModule', [require('highcharts'),require('highcharts-ng')]);
這樣仍是不行,報錯很明顯。。。網上查了說:要引入一個commonjs版的highcharts,好的。。。學習
npm install --sava-dev commonjs-highcharts
仍是不行。。。而後我仔細想了一下,highcharts自己並不用導入angular,有highcharts-ng作代理,這個應該這麼寫:ui
require('commonjs-highcharts');
var statisticModule = angular.module('statisticModule', [require('highcharts-ng')]);
順利出圖了。謝謝各位網友的無私奉獻!spa