Skip to content

Commit e6fcbc0

Browse files
authored
chore: generate api docs for additional classes (#2345)
1 parent 2209308 commit e6fcbc0

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

src/lib/snack-bar/snack-bar-ref.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,18 @@ import {MdSnackBarContainer} from './snack-bar-container';
99
* Reference to a snack bar dispatched from the snack bar service.
1010
*/
1111
export class MdSnackBarRef<T> {
12-
/** The instance of the component making up the content of the snack bar. */
13-
readonly instance: T;
12+
private _instance: T;
1413

1514
/** The instance of the component making up the content of the snack bar. */
16-
readonly containerInstance: MdSnackBarContainer;
15+
get instance(): T {
16+
return this._instance;
17+
}
18+
19+
/**
20+
* The instance of the component making up the content of the snack bar.
21+
* @docs-private
22+
*/
23+
containerInstance: MdSnackBarContainer;
1724

1825
/** Subject for notifying the user that the snack bar has closed. */
1926
private _afterClosed: Subject<any> = new Subject();
@@ -28,7 +35,7 @@ export class MdSnackBarRef<T> {
2835
containerInstance: MdSnackBarContainer,
2936
private _overlayRef: OverlayRef) {
3037
// Sets the readonly instance of the snack bar content component.
31-
this.instance = instance;
38+
this._instance = instance;
3239
this.containerInstance = containerInstance;
3340
// Dismiss snackbar on action.
3441
this.onAction().subscribe(() => this.dismiss());

tools/dgeni/processors/component-grouper.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class ComponentGroup {
1414
this.docType = 'componentGroup';
1515
this.directives = [];
1616
this.services = [];
17+
this.additionalClasses = [];
1718
this.ngModule = null;
1819
}
1920
}
@@ -50,6 +51,8 @@ module.exports = function componentGrouper() {
5051
group.services.push(doc);
5152
} else if (doc.isNgModule) {
5253
group.ngModule = doc;
54+
} else if (doc.docType == 'class') {
55+
group.additionalClasses.push(doc);
5356
}
5457
});
5558

tools/dgeni/templates/componentGroup.template.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,10 @@ <h2>Directives</h2>
5252
{$ class(directive) $}
5353
{% endfor %}
5454
{%- endif -%}
55+
56+
{%- if doc.additionalClasses.length -%}
57+
<h2>Additional classes</h2>
58+
{% for other in doc.additionalClasses %}
59+
{$ class(other) $}
60+
{% endfor %}
61+
{%- endif -%}

0 commit comments

Comments
 (0)