?
Dieses Dokument verwendet PHP-Handbuch für chinesische Websites Freigeben
歡迎訪問AngularJS API文檔頁面. 這些頁面是對(duì)1.3.0-beta.15 unbelievable-advancement版本的AngularJS參考資料。
文檔按多個(gè)模塊的形式進(jìn)行組織,每個(gè)模塊包含AngularJS應(yīng)用程序所需的包含各種組件,這些組件有 directives、services、filters、providers、templates、global APIs, 和 testing mocks。
$
and $$
為防止和你的代碼的名稱產(chǎn)生沖突,Angular公共對(duì)象的前綴名使用$
,私有對(duì)象名使用$$
。請(qǐng)不要在你的代碼中使用 $
或$$
前綴。這個(gè)模塊是默認(rèn)提供的,它包含了AngularJS的核心組件。
Directives |
這些核心指令集可用于你的AngularJS應(yīng)用的模板代碼中。 例如:ngClick, ngInclude, ngRepeat… |
Services / Factories |
這些核心服務(wù)集可通過依賴注入(DI)來供你的應(yīng)用使用。 例如:$compile, $http, $location… |
Filters |
這些ng模塊中的核心過濾器用于在指令和表達(dá)式被渲染前轉(zhuǎn)換模板數(shù)據(jù)。 例如:filter, date, currency, lowercase, uppercase... |
Global APIs |
附加在angular對(duì)象上的核心公共API函數(shù)。這些核心函數(shù)對(duì)于你應(yīng)用中的低級(jí)JavaScript操作很有用。 例如:angular.copy(), angular.equals(), angular.element()... |
使用ngRoute讓你的應(yīng)用具有URL路由功能。ngRoute模塊支持hashbang和HTML5 pushState方式的URL管理。
Services / Factories |
下面這些服務(wù)用于路由管理:
|
Directives | ngView用于在頁面中根據(jù)當(dāng)前路由顯示模板。 |
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...
|