-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadme.txt
50 lines (41 loc) · 1.38 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#npm网络不稳定,这里使用淘宝镜像
npm config set proxy null
npm install cnpm -g --registry=https://registry.npm.taobao.org
ng set --global packageManager=cnpm
cnpm install -g @angular/cli
ng new XXXX --routing
cd XXXX
cnpm install --save [email protected] (bootstrap兼容)
cnpm install --save [email protected]
#typescript不识别jquery,bootstrap等插件,需要安装下面两个插件用来识别用
cnpm intall @types/jquery --save-dev
cnpm intall @types/bootstrap --save-dev
angular-cli中,更新第三方库引用:
"styles": [
"styles.css",
"../node_modules/[email protected]@bootstrap/dist/css/bootstrap.css"
],
"scripts": [
"../node_modules/[email protected]@jquery/dist/jquery.js",
"../node_modules/[email protected]@bootstrap/dist/js/bootstrap.js"
],
#国际化插件
cnpm install @ngx-translate/core --save
cnpm install @ngx-translate/http-loader --save
#新建组件
ng g component navbar #导航条
ng g component footer #底部组件
ng g component search #表单搜索组件
ng g component carousel #轮播图组件
ng g component product #产品信息组件
ng g component stars #星级评价组件
#新建服务
ng g service XXXXX
npm i -g json-server (Mock Rest API)
ng serve --open
npm start
生成d.ts文件用
安装dtsmake命令 npm install -g dtsmake(根目录下安装)
安装tern命令 npm install -g tern
进入该文件目录下,dtsmake -s xxxxxx.js
替换 node_modules\[email protected]@bootstrap\dist\css\bootstrap.css