freeCodeCamp/guide/chinese/angularjs/index.md

48 lines
889 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
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>
```