Skip to content

Commit 5ad5301

Browse files
wardbellchuckjaz
authored andcommitted
feat(aio): add API list page (angular#14899)
1 parent 174d4c8 commit 5ad5301

File tree

11 files changed

+4453
-2
lines changed

11 files changed

+4453
-2
lines changed

aio/content/marketing/api.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<aio-api-list></aio-api-list>

aio/src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { Platform } from '@angular/material/core';
1616
import 'rxjs/add/operator/first';
1717

1818
import { AppComponent } from 'app/app.component';
19+
import { ApiService } from 'app/embedded/api/api.service';
1920
import { DocViewerComponent } from 'app/layout/doc-viewer/doc-viewer.component';
2021
import { embeddedComponents, EmbeddedComponents } from 'app/embedded';
2122
import { Logger } from 'app/shared/logger.service';
@@ -48,6 +49,7 @@ import { LinkDirective } from 'app/shared/link.directive';
4849
LinkDirective,
4950
],
5051
providers: [
52+
ApiService,
5153
EmbeddedComponents,
5254
Logger,
5355
Location,

aio/src/app/documents/document.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ export class DocumentService {
5757
return subject.asObservable();
5858
}
5959

60-
private computePath(url) {
60+
private computePath(url: string) {
61+
url = url.match(/[^#?]*/)[0]; // strip off fragment and query
6162
url = '/' + url;
6263
url = url.endsWith('/') ? url + 'index' : url;
6364
return 'content/docs' + url + '.json';
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<div class="l-flex-wrap banner is-plain api-filter">
2+
3+
<div class="form-select-menu">
4+
<button class="form-select-button has-symbol" (click)="toggleTypeMenu()">
5+
<strong>Type:</strong><span class="symbol {{type.name}}"></span>{{type.title}}
6+
</button>
7+
<ul class="form-select-dropdown" *ngIf="showTypeMenu">
8+
<li *ngFor="let t of types" (click)="setType(t)" [class.selected]="t === type">
9+
<span class="symbol {{t.name}}"></span>{{t.title}}
10+
</li>
11+
</ul>
12+
</div>
13+
14+
<div class="form-select-menu">
15+
<button class="form-select-button" (click)="toggleStatusMenu()">
16+
<strong>Status:</strong>{{status.title}}
17+
</button>
18+
<ul class="form-select-dropdown" *ngIf="showStatusMenu">
19+
<li *ngFor="let s of statuses" (click)="setStatus(s)" [class.selected]="s === status">
20+
{{s.title}}
21+
</li>
22+
</ul>
23+
</div>
24+
25+
<div class="form-search">
26+
<i class="material-icons">search</i>
27+
<input #filter placeholder="Filter" (input)="setQuery($event.target.value)">
28+
</div>
29+
</div>
30+
31+
<article class="l-content-small docs-content">
32+
<div *ngFor="let section of filteredSections | async" >
33+
<h2>{{section.title}}</h2>
34+
<ul class="api-list">
35+
<ng-container *ngFor="let item of section.items">
36+
<li *ngIf="item.show" class="api-item">
37+
<a [href]="item.path"><span class="symbol {{item.docType}}"></span> {{item.title}}</a>
38+
</li>
39+
</ng-container>
40+
</ul>
41+
</div>
42+
</article>

0 commit comments

Comments
 (0)