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

Commit fad6c7c

Browse files
docs(componentRouter): add custom installation instructions
1 parent 4b2bc60 commit fad6c7c

File tree

6 files changed

+118
-1
lines changed

6 files changed

+118
-1
lines changed

docs/config/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ module.exports = new Package('angularjs', [
5454
.config(function(parseTagsProcessor) {
5555
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/tutorial-step'));
5656
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/sortOrder'));
57+
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/installation'));
5758
})
5859

5960

docs/config/tag-defs/installation.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
name: 'installation'
3+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{% extends "base.template.html" %}
2+
3+
{% block content %}
4+
<h1>
5+
{% if doc.title %}{$ doc.title | marked $}{% else %}{$ doc.name | code $}{% endif %}
6+
</h1>
7+
8+
{% if doc.installation or doc.installation == '' %}
9+
{$ doc.installation | marked $}
10+
{% else %}
11+
<h2>Installation</h2>
12+
13+
<p>First include {$ doc.packageFile | code $} in your HTML:</p>
14+
15+
{% code %}
16+
<script src="angular.js">
17+
<script src="{$ doc.packageFile $}">
18+
{% endcode %}
19+
20+
<p>You can download this file from the following places:</p>
21+
<ul>
22+
<li>
23+
<a href="https://developers.google.com/speed/libraries/devguide#angularjs">Google CDN</a><br>
24+
e.g. {$ ("//ajax.googleapis.com/ajax/libs/angularjs/X.Y.Z/" + doc.packageFile) | code $}
25+
</li>
26+
<li>
27+
<a href="http://bower.io">Bower</a><br>
28+
e.g. {% code %}bower install {$ doc.packageName $}@X.Y.Z{% endcode %}
29+
</li>
30+
<li>
31+
<a href="http://code.angularjs.org/">code.angularjs.org</a><br>
32+
e.g. {% code %}"//code.angularjs.org/X.Y.Z/{$ doc.packageFile $}"{% endcode %}
33+
</li>
34+
</ul>
35+
<p>where X.Y.Z is the AngularJS version you are running.</p>
36+
<p>Then load the module in your application by adding it as a dependent module:</p>
37+
{% code %}
38+
angular.module('app', ['{$ doc.name $}']);
39+
{% endcode %}
40+
41+
<p>With that you&apos;re ready to get started!</p>
42+
{% endif %}
43+
44+
{$ doc.description | marked $}
45+
46+
{% if doc.knownIssueDocs %}
47+
<div class="known-issues">
48+
<h2 id="known-issues">Known Issues</h2>
49+
<table class="definition-table">
50+
<tr><th>Name</th><th>Description</th></tr>
51+
{% for issueDoc in doc.knownIssueDocs -%}
52+
<tr>
53+
<td>{$ issueDoc.id | link(issueDoc.name, issueDoc) $}</td>
54+
<td>
55+
{% for issue in issueDoc.knownIssues -%}
56+
{$ issue | marked $}
57+
{% endfor -%}
58+
</td>
59+
</tr>
60+
{% endfor -%}
61+
</table>
62+
</div>
63+
{% endif %}
64+
65+
66+
<div class="component-breakdown">
67+
<h2>Module Components</h2>
68+
{% for componentGroup in doc.componentGroups %}
69+
<div>
70+
<h3 class="component-heading" id="{$ componentGroup.groupType | dashCase $}">{$ componentGroup.groupType | title $}</h3>
71+
<table class="definition-table">
72+
<tr>
73+
<th>Name</th>
74+
<th>Description</th>
75+
</tr>
76+
{% for component in componentGroup.components %}
77+
<tr>
78+
<td>{$ component.id | link(component.name, component) $}</td>
79+
<td>{$ component.description | firstParagraph | marked $}</td>
80+
</tr>
81+
{% endfor %}
82+
</table>
83+
</div>
84+
{% endfor %}
85+
</div>
86+
87+
{% if doc.usage %}
88+
<h2>Usage</h2>
89+
{$ doc.usage | marked $}
90+
{% endif %}
91+
92+
{% endblock %}

src/Angular.js

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
* @ngdoc module
103103
* @name ng
104104
* @module ng
105+
* @installation
105106
* @description
106107
*
107108
* # ng (core module)

src/auto/injector.js

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
/**
5858
* @ngdoc module
5959
* @name auto
60+
* @installation
6061
* @description
6162
*
6263
* Implicit module which gets automatically added to each {@link auto.$injector $injector}.

src/ngComponentRouter/Router.js

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
11
/**
22
* @ngdoc module
33
* @name ngComponentRouter
4+
* @installation
5+
* ## Installation
6+
*
7+
* Currently use `npm` to install the **Component Router** module:
8+
*
9+
* ```bash
10+
* npm install @angular/router --save
11+
* ```
12+
*
13+
* Include `angular_1_router.js` in your HTML:
14+
* ```html
15+
* <script src="/node_modules/@angular/router/angular1/angular_1_router.js"></script>
16+
*```
17+
*
18+
* Then load the module in your application by adding it as a dependent module:
19+
*
20+
* ```js
21+
* angular.module('app', ['ngComponentRouter']);
22+
* ```
23+
*
424
* @description
5-
* The new Angular Router
625
*/
726

827
/**

0 commit comments

Comments
 (0)