48 lines
889 B
Markdown
48 lines
889 B
Markdown
---
|
||
title: AngularJS
|
||
localeTitle: AngularJS
|
||
---
|
||
## AngularJS
|
||
![alt text](https://angular.io/assets/images/logos/angular/angular.png)
|
||
|
||
AngularJS(版本1.x)是一个开源的前端JavaScript框架。 AngularJS扩展了HTML以开发丰富而强大的前端。 它减少了HTML代码的重复使用。通过使用AngularJS提供的保存指令可以避免这种重复 很多时间和精力。
|
||
|
||
**安装** :
|
||
|
||
安装node.js
|
||
|
||
安装完毕检查node.js的版本,运行如下代码:
|
||
|
||
```shell
|
||
node --version
|
||
```
|
||
|
||
通过Node.js的npm命令安装最新版本的npm/bower
|
||
|
||
```shell
|
||
npm install -g npm
|
||
npm install -g bower
|
||
```
|
||
通过npm安装:
|
||
|
||
```shell
|
||
npm install angular
|
||
```
|
||
HTML:
|
||
|
||
```html
|
||
<script src="/node_modules/angular/angular.js"></script>
|
||
```
|
||
|
||
通过bower安装:
|
||
|
||
```shell
|
||
bower install angular
|
||
```
|
||
HTML:
|
||
|
||
```html
|
||
<script src="/bower_components/angular/angular.js"></script>
|
||
```
|
||
|