?
This document uses PHP Chinese website manual Release
歡迎訪問AngularJS API文檔頁面. 這些頁面是對1.3.0-beta.15 unbelievable-advancement版本的AngularJS參考資料。
文檔按多個模塊的形式進行組織,每個模塊包含AngularJS應用程序所需的包含各種組件,這些組件有 directives、services、filters、providers、templates、global APIs, 和 testing mocks。
$
and $$
為防止和你的代碼的名稱產(chǎn)生沖突,Angular公共對象的前綴名使用$
,私有對象名使用$$
。請不要在你的代碼中使用 $
或$$
前綴。這個模塊是默認提供的,它包含了AngularJS的核心組件。
Directives |
這些核心指令集可用于你的AngularJS應用的模板代碼中。 例如:ngClick, ngInclude, ngRepeat… |
Services / Factories |
這些核心服務集可通過依賴注入(DI)來供你的應用使用。 例如:$compile, $http, $location… |
Filters |
這些ng模塊中的核心過濾器用于在指令和表達式被渲染前轉換模板數(shù)據(jù)。 例如:filter, date, currency, lowercase, uppercase... |
Global APIs |
附加在angular對象上的核心公共API函數(shù)。這些核心函數(shù)對于你應用中的低級JavaScript操作很有用。 例如:angular.copy(), angular.equals(), angular.element()... |
使用ngRoute讓你的應用具有URL路由功能。ngRoute模塊支持hashbang和HTML5 pushState方式的URL管理。
Services / Factories |
下面這些服務用于路由管理:
|
Directives | ngView用于在頁面中根據(jù)當前路由顯示模板。 |
Use ngAnimate to enable animation features into your application. Various core ng directives will provide animation hooks into your application when ngAnimate is included. Animations are defined by using CSS transitions/animations or JavaScript callbacks.
Services / Factories | Use $animate to trigger animation operations within your directive code. |
CSS-based animations | Follow ngAnimate’s CSS naming structure to reference CSS transitions / keyframe animations in AngularJS. Once defined the animation can be triggered by referencing the CSS class within the HTML template code. |
JS-based animations | Use module.animation() to register a JavaScript animation. Once registered the animation can be triggered by referencing the CSS class within the HTML template code. |
Use the ngResource module when querying and posting data to a REST API.
Services / Factories | The $resource service is used to define RESTful objects which communicate with a REST API. |
Use the ngCookies module to handle cookie management within your application.
Services / Factories |
The following services are used for cookie management:
|
Use ngTouch when developing for mobile browsers/devices.
Services / Factories | The $swipe service is used to register and manage mobile DOM events. |
Directives | Various directives are available in ngTouch to emulate mobile DOM events. |
Use ngSanitize to securely parse and manipulate HTML data in your application.
Services / Factories | The $sanitize service is used to clean up dangerous HTML code in a quick and convenient way. |
Filters | The linky filter is used to turn URLs into HTML links within the provided string. |
Use ngMock to inject and mock modules, factories, services and providers within your unit tests
Services / Factories |
ngMock will extend the behavior of various core services to become testing aware and manageable in a synchronous manner.
Some examples include: $timeout, $interval, $log, $httpBackend, etc...
|
Global APIs |
Various helper functions are available to inject and mock modules within unit test code. Some examples inject(), module(), dump(), etc...
|