diff --git a/aspnet/client-side/angular.rst b/aspnet/client-side/angular.rst index 48fb48f83..89c79efea 100644 --- a/aspnet/client-side/angular.rst +++ b/aspnet/client-side/angular.rst @@ -1,34 +1,36 @@ -Using Angular for Single Page Applications (SPAs) +使用Angular构建单页应用程序(SPAs) ================================================= -By `Venkata Koppaka`_ and `Scott Addie`_ +作者: `Venkata Koppaka`_ 和 `Scott Addie`_ -In this article, you will learn how to build a SPA-style ASP.NET application using AngularJS. +翻译: `耿晓亮(Blue)`_ + +在本文中你会学到如何通过 AngularJS 构建一个 SPA-style ASP.NET 应用程序。 .. contents:: Sections: :local: :depth: 1 -`View or download sample code `__ +`查看或者下载示例代码 `__ -What is AngularJS? +什么事 AngularJS ? ------------------ -`AngularJS `_ is a modern JavaScript framework from Google commonly used to work with Single Page Applications (SPAs). AngularJS is open sourced under MIT license, and the development progress of AngularJS can be followed on `its GitHub repository `_. The library is called Angular because HTML uses angular-shaped brackets. +`AngularJS `_ 是 Google 通常用来处理单页面应用程序(SPAs)的一个现代化 JavaScript 框架。AngularJS 是遵从 MIT 协议的开源项目,AngularJS 的开发进度可以跟踪 `它的 GitHub repository `_。因为 HTML 使用尖角号所以命名 Angular。 -AngularJS is not a DOM manipulation library like jQuery, but it uses a subset of jQuery called jQLite. AngularJS is primarily based on declarative HTML attributes that you can add to your HTML tags. You can try AngularJS in your browser using the `Code School website `_. +AngularJS 不是像 jQuery 一样的 DOM 操作库,但是它用了 jQuery 的一个叫 jQLite 的子集。AngularJS 主要是基于 HTML 特性的声明所有你可以添加到 HTML 标签里。你可以通过 `Code School 网站 `_ 在浏览器里尝试 AngularJS。 -Version 1.5.x is the current stable version and the Angular team is working towards a big rewrite of AngularJS for V2.0 which is currently still in development. This article focuses on Angular 1.X with some notes on where Angular is heading with 2.0. +当前稳定版是 1.5.x 并且 Angular 团队正在致力于 AngularJS 的一个大改动的 V2.0 版目前仍然在开发中。本文专注在 Angular 1.X 附带一些 Angular 2.0 方向的注释。 -Getting Started +入门 --------------- -To start using AngularJS in your ASP.NET application, you must either install it as part of your project, or reference it from a content delivery network (CDN). +开始在 ASP.NET 应用程序里应用 AngularJS 前,首先你必须安装它来作为你项目的一部分,或者从内容分发网络(CDN)引用。 -Installation +安装 ^^^^^^^^^^^^ -There are several ways to add AngularJS to your application. If you’re starting a new ASP.NET Core web application in Visual Studio, you can add AngularJS using the built-in :ref:`Bower ` support. Simply open ``bower.json``, and add an entry to the ``dependencies`` property: +有几种方式添加 AngularJS 到你的应用程序。如果你正在 Visual Studio 里开始一个新的 ASP.NET Core web 应用程序,你可以通过内置 :ref:`Bower ` 添加 AngularJS 。只需打开 ``bower.json``,并添加一个条目到 ``dependencies`` 属性: .. _angular-bower-json: @@ -37,12 +39,12 @@ There are several ways to add AngularJS to your application. If you’re startin :linenos: :emphasize-lines: 9 -Upon saving the ``bower.json`` file, Angular will be installed in your project's ``wwwroot/lib`` folder. Additionally, it will be listed within the ``Dependencies/Bower`` folder. See the screenshot below. +一旦保存 ``bower.json`` 文件,Angular 将会安装到项目的 ``wwwroot/lib`` 文件夹。另外,还会在 ``Dependencies/Bower`` 文件夹中列出来。见下边的截图。 .. image:: angular/_static/angular-solution-explorer.png :width: 283px -Next, add a ``