Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit a7e12b7

Browse files
committed
feat(docs): provide index pages for each angular module
1 parent 3f568b2 commit a7e12b7

File tree

13 files changed

+400
-18
lines changed

13 files changed

+400
-18
lines changed

docs/components/angular-bootstrap/bootstrap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ directive.table = function() {
193193
return {
194194
restrict: 'E',
195195
link: function(scope, element, attrs) {
196-
element[0].className = 'table table-bordered table-striped code-table';
196+
element.addClass('table table-bordered table-striped code-table');
197197
}
198198
};
199199
};

docs/content/api/index.ngdoc

+283-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,286 @@
22
@name API Reference
33
@description
44

5-
Use the API Reference documentation when you need more information about a specific feature. Check out
6-
{@link guide/ Developer Guide} for AngularJS concepts. If you are new to AngularJS we recommend the
7-
{@link tutorial/ Tutorial}.
5+
# AngularJS API Docs
6+
Welcome to the AngularJS API docs page. The pages here contain the AngularJS reference materials for version <strong ng-bind="version"></strong>.
7+
8+
The docs are organized into **modules** which contain various components of an AngularJS application.
9+
These components are directives, services, filters, providers, types, global APIs and testing mocks.
10+
11+
## {@link ng ng (core module)}
12+
This module is provided by default and contains the core components of AngularJS.
13+
14+
<table class="definition-table spaced">
15+
<tr>
16+
<td>{@link ng#directive Directives}</td>
17+
<td>
18+
<p>
19+
This is the core collection of directives you would use in your template code to build an AngularJS application.
20+
</p>
21+
22+
<p>
23+
Some examples include:
24+
{@link ng.ngClick ngClick},
25+
{@link ng.ngInclude ngInclude},
26+
{@link ng.ngInclude ngRepeat},
27+
etc… <br />
28+
</p>
29+
</td>
30+
</tr>
31+
<tr>
32+
<td>
33+
{@link ng#service Services / Factories}
34+
</td>
35+
<td>
36+
<p>
37+
This is the core collection of services which are used within the DI of your application.
38+
</p>
39+
<p>
40+
Some examples include:
41+
{@link ng.$compile $compile},
42+
{@link ng.$http $http},
43+
{@link ng.$routeParams $routeParams},
44+
{@link ng.$location $location},
45+
etc…
46+
<p>
47+
</td>
48+
</tr>
49+
<tr>
50+
<td>
51+
{@link ng#filter Filters}
52+
</td>
53+
<td>
54+
<p>
55+
The core filters available in the ng module are used to transform template data before it is renders within directives and expressions.
56+
</p>
57+
<p>
58+
Some examples include:
59+
{@link ng.filter:filter filter},
60+
{@link ng.filter:date date},
61+
{@link ng.filter:currency currency},
62+
{@link ng.filter:lowercase lowercase},
63+
{@link ng.filter:uppercase uppercase},
64+
etc...
65+
</p>
66+
</td>
67+
</tr>
68+
<tr>
69+
<td>
70+
{@link ng#function Global APIs}
71+
</td>
72+
<td>
73+
<p>
74+
The core global API functions are attached to the angular object. These core functions are useful for low level JavaScript operations within your application.
75+
</p>
76+
<p>
77+
Some examples include:
78+
{@link angular.copy angular.copy()},
79+
{@link angular.equals angular.equals()},
80+
{@link angular.element angular.element()},
81+
etc...
82+
</p>
83+
</td>
84+
</tr>
85+
</table>
86+
87+
88+
## {@link ngRoute ngRoute}
89+
90+
Use ngRoute to enable URL routing to your application. The ngRoute module supports URL management via both hashbang and HTML5 pushState.
91+
92+
<div class="alert alert-info">Include the **angular-route.js** file and set **ngRoute** as a dependency for this to work in your application.</div>
93+
94+
<table class="definition-table spaced">
95+
<tr>
96+
<td>
97+
{@link ngRoute#service Services / Factories}
98+
</td>
99+
<td>
100+
The following services are used for route management:
101+
<ul>
102+
<li>{@link ngRoute.$routeParams $routeParams} is used to access the querystring values present in the URL.</li>
103+
<li>{@link ngRoute.$route $route} is used to access the details of the route that is currently being accessed.</li>
104+
<li>{@link ngRoute.$routeProvider $routeProvider} is used to register routes for the application.</li>
105+
</ul>
106+
</td>
107+
</tr>
108+
<tr>
109+
<td>
110+
{@link ngRoute#directive Directives}
111+
</td>
112+
<td>
113+
The {@link ngRoute.directive:ngView ngView} directive will display the template of the current route within the page.
114+
</td>
115+
</tr>
116+
</table>
117+
118+
119+
## {@link ngAnimate ngAnimate}
120+
121+
Use ngAnimate to enable animation features into your application. Various core ng directives will provide
122+
animation hooks into your application when ngAnimate is included. Animations are defined by using CSS transitions/animations
123+
or JavaScript callbacks.
124+
125+
<div class="alert alert-info">Include the **angular-animate.js** file and set **ngAnimate** as a dependency for this to work in your application.</div>
126+
127+
<table class="definition-table spaced">
128+
<tr>
129+
<td>
130+
{@link ngAnimate#service Services / Factories}
131+
</td>
132+
<td>
133+
Use {@link ngAnimate.$animate $animate} to trigger animation operations within your directive code.
134+
</td>
135+
</tr>
136+
<tr>
137+
<td>
138+
{@link ngAnimate CSS-based animations}
139+
</td>
140+
<td>
141+
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.
142+
</td>
143+
</tr>
144+
<tr>
145+
<td>
146+
{@link ngAnimate JS-based animations}
147+
</td>
148+
<td>
149+
Use {@link angular.Module#animation module.animation()} to register a JavaScript animation. Once registered the animation can be triggered by referencing the CSS class within the HTML template code.
150+
</td>
151+
</tr>
152+
</table>
153+
154+
155+
## {@link ngResource ngResource}
156+
157+
Use the ngResource module when querying and posting data to a REST API.
158+
159+
<div class="alert alert-info">Include the **angular-resource.js** file and set **ngResource** as a dependency for this to work in your application.</div>
160+
161+
<table class="definition-table spaced">
162+
<tr>
163+
<td>
164+
{@link ngResource#service Services / Factories}
165+
</td>
166+
<td>
167+
The {@link ngResource.$resource $resource} service is used to define RESTful objects which communicate with a REST API.
168+
</td>
169+
</tr>
170+
</table>
171+
172+
## {@link ngCookies ngCookies}
173+
174+
Use the ngCookies module to handle cookie management within your application.
175+
176+
<div class="alert alert-info">Include the **angular-cookies.js** file and set **ngCookies** as a dependency for this to work in your application.</div>
177+
178+
<table class="definition-table spaced">
179+
<tr>
180+
<td>
181+
{@link ngCookies#service Services / Factories}
182+
</td>
183+
<td>
184+
The following services are used for cookie management:
185+
<ul>
186+
<li>The {@link ngCookies.$cookies $cookie} service is a convenient wrapper to store simple data within browser cookies.</li>
187+
<li>{@link ngCookies.$cookieStore $cookieStore} is used to store more complex data using serialization.</li>
188+
</ul>
189+
</td>
190+
</tr>
191+
</table>
192+
193+
## {@link ngTouch ngTouch}
194+
195+
Use ngTouch when developing for mobile browsers/devices.
196+
197+
<div class="alert alert-info">Include the **angular-touch.js** file and set **ngTouch** as a dependency for this to work in your application.</div>
198+
199+
<table class="definition-table spaced">
200+
<tr>
201+
<td>
202+
{@link ngTouch#service Services / Factories}
203+
</td>
204+
<td>
205+
The {@link ngTouch.$swipe $swipe} service is used to register and manage mobile DOM events.
206+
</td>
207+
</tr>
208+
<tr>
209+
<td>
210+
{@link ngTouch#directive Directives}
211+
</td>
212+
<td>
213+
Various directives are available in ngTouch to emulate mobile DOM events.
214+
</td>
215+
</tr>
216+
</table>
217+
218+
## {@link ngSanitize ngSanitize}
219+
220+
Use ngSanitize to securely parse and manipulate HTML data in your application.
221+
222+
<div class="alert alert-info">Include the **angular-sanitize.js** file and set **ngSanitize** as a dependency for this to work in your application.</div>
223+
224+
<table class="definition-table spaced">
225+
<tr>
226+
<td>
227+
{@link ngSanitize#service Services / Factories}
228+
</td>
229+
<td>
230+
The {@link ngSanitize.$sanitize $sanitize} service is used to clean up dangerous HTML code in a quick and convenient way.
231+
</td>
232+
</tr>
233+
<tr>
234+
<td>
235+
{@link ngTouch#filter Filters}
236+
</td>
237+
<td>
238+
The {@link ngSanitize.filter:linky linky filter} is used to turn URLs into HTML links within the provided string.
239+
</td>
240+
</tr>
241+
</table>
242+
243+
## {@link ngMock ngMock}
244+
245+
Use ngMock to inject and mock modules, factories, services and providers within your unit tests
246+
247+
<div class="alert alert-info">Include the **angular-mocks.js** file into your test runner for this to work.</div>
248+
249+
<table class="definition-table spaced">
250+
<tr>
251+
<td>
252+
{@link ngMock#service Services / Factories}
253+
</td>
254+
<td>
255+
<p>
256+
ngMock will extend the behavior of various core services to become testing aware and manageable in a synchronous manner.
257+
<p>
258+
259+
<p>
260+
Some examples include:
261+
{@link ngMock.$timeout $timeout},
262+
{@link ngMock.$interval $interval},
263+
{@link ngMock.$log $log},
264+
{@link ngMock.$httpBackend $httpBackend},
265+
etc...
266+
<p>
267+
</td>
268+
</tr>
269+
<tr>
270+
<td>
271+
{@link ngMock#function Global APIs}
272+
</td>
273+
<td>
274+
<p>
275+
Various helper functions are available to inject and mock modules within unit test code.
276+
</p>
277+
278+
<p>
279+
Some examples
280+
{@link angular.mock.inject inject()},
281+
{@link angular.mock.module module()},
282+
{@link angular.mock.dump dump()},
283+
etc...
284+
<p>
285+
</td>
286+
</tr>
287+
</table>

docs/content/api/ng.ngdoc

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
@name ng
33
@description
44

5-
`ng` is the name of the {@link guide/module angular module} that contains all of the core angular services.
5+
# ng (core module)
6+
The ng module is loaded by default when an AngularJS application is started. The module itself contains the essential components to for an AngularJS application to function. The table below lists a high level breakdown of each of the services/factories, filters, directives and testing components available within this core module.
7+
8+
<div doc-module-components="ng"></div>

docs/src/ngdoc.js

+19
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,14 @@ Doc.prototype = {
213213
return words.join(' ');
214214
},
215215

216+
shortDescription : function() {
217+
var text = this.description.split("\n")[0];
218+
text = text.replace(/<.+?\/?>/g, '');
219+
text = text.replace(/{/g,'&#123;');
220+
text = text.replace(/}/g,'&#125;');
221+
return text;
222+
},
223+
216224
getMinerrNamespace: function () {
217225
if (this.ngdoc !== 'error') {
218226
throw new Error('Tried to get the minErr namespace, but @ngdoc ' +
@@ -471,11 +479,20 @@ Doc.prototype = {
471479
(this.ngdoc === 'error' ? this.name : '') ||
472480
(((this.file||'').match(/.*(\/|\\)([^(\/|\\)]*)\.ngdoc/)||{})[2]) || // try to extract it from file name
473481
this.name; // default to name
482+
this.moduleName = parseModuleName(this.id);
474483
this.description = this.markdown(this.description);
475484
this.example = this.markdown(this.example);
476485
this['this'] = this.markdown(this['this']);
477486
return this;
478487

488+
function parseModuleName(id) {
489+
var module = id.split('.')[0];
490+
if(module == 'angular') {
491+
module = 'ng';
492+
}
493+
return module;
494+
}
495+
479496
function flush() {
480497
if (atName) {
481498
var text = trim(atText.join('\n')), match;
@@ -1106,6 +1123,8 @@ function metadata(docs){
11061123
name: title(doc),
11071124
shortName: shortName,
11081125
type: doc.ngdoc,
1126+
moduleName: doc.moduleName,
1127+
shortDescription: doc.shortDescription(),
11091128
keywords:doc.keywords()
11101129
});
11111130
});

docs/src/templates/css/docs.css

+23
Original file line numberDiff line numberDiff line change
@@ -508,3 +508,26 @@ pre ol li {
508508
font-size: 16px;
509509
word-break: normal;
510510
}
511+
512+
.text-info {
513+
color:#3a87ad;
514+
}
515+
516+
.definition-table tr > td:first-child {
517+
font-weight:bold;
518+
width:30%;
519+
}
520+
521+
.definition-table.spaced {
522+
margin-bottom:30px;
523+
}
524+
525+
.component-heading {
526+
text-transform:capitalize;
527+
}
528+
529+
.component-breakdown {
530+
margin-bottom:30px;
531+
padding-bottom:30px;
532+
border-bottom:1px solid #aaa;
533+
}

0 commit comments

Comments
 (0)