Skip to content

Commit

Permalink
docs: update api
Browse files Browse the repository at this point in the history
  • Loading branch information
alyleui committed Oct 17, 2018
1 parent b0e7cdb commit 6c9658f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/app/api/api.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h3 [lyTyp]="'title'" gutter>{{ variable.name }}</h3>
<ng-container *ngIf="api.miscellaneous.variables.length">
<h2 [lyTyp]="'headline'" gutter>Default variables</h2>
<ng-container *ngFor="let variable of api.miscellaneous.variables">
<p><span prism language="typescript" code="const {{variable.name}} = {{variable.defaultValue}};"></span></p>
<p><prism language="typescript" code="const {{variable.name}} = {{variable.defaultValue}};"></prism></p>
</ng-container>
</ng-container>
</ng-container>
Expand Down
20 changes: 10 additions & 10 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<aui-app-bar></aui-app-bar>
<ly-drawer-container>
<ly-drawer-content>
<div class="app-container">
<div class="demo">
<app-title [route]="router.url"></app-title>
<div class="docs-viewer">
<router-outlet></router-outlet>
</div>
</div>
</div>
</ly-drawer-content>
<ly-drawer bg="background:primary" [width]="'230px 0@XSmall'" #nav="lyDrawer" [opened]="router.url !== '/'" [mode]="router.url !== '/' ? 'side' : 'over'" #_left [spacingTop]="'64px 56px@XSmall'">
<ul *ngFor="let category of routesComponents" [withClass]="classes.drawerUl">
<span lyTyp="subheading" gutterBottom>{{ category.name }}</span>
Expand All @@ -11,14 +21,4 @@
</li>
</ul>
</ly-drawer>
<ly-drawer-content>
<div class="app-container">
<div class="demo">
<app-title [route]="router.url"></app-title>
<div class="docs-viewer">
<router-outlet></router-outlet>
</div>
</div>
</div>
</ly-drawer-content>
</ly-drawer-container>
Empty file.
17 changes: 12 additions & 5 deletions src/app/document/title/title.component.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Component, OnInit, ChangeDetectionStrategy, Input } from '@angular/core';
import { Component, OnInit, ChangeDetectionStrategy, Input, ViewEncapsulation } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { Platform } from '@alyle/ui';
import { environment } from '@env/environment';

@Component({
selector: 'app-title',
templateUrl: './title.component.html',
styleUrls: ['./title.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None
})
export class TitleComponent implements OnInit {
private _route: string;
Expand All @@ -21,9 +21,16 @@ export class TitleComponent implements OnInit {
const varArray = val.split('/').filter(_ => !!_);
const latestItem = varArray[varArray.length - 1];
this.urls = varArray.map(_ => _.charAt(0).toUpperCase() + _.slice(1));
this.title = toTitle(latestItem === 'api' ? `${varArray[varArray.length - 2]} API` : latestItem);
this.title = toTitle(latestItem);
if (this.title) {
this.titleService.setTitle(`${this.title} | ${this.defaultTitle}`);
if (varArray.some(_ => _ === 'layout' || _ === 'components')) {
const name = varArray[0] === 'components' ? varArray[0].slice(0, -1) : varArray[0];
this.titleService.setTitle(`${this.title} Angular ${name} | ${this.defaultTitle}`);
} else if (varArray.some(_ => _ === 'api')) {
this.titleService.setTitle(`${this.title} API | ${this.defaultTitle}`);
} else {
this.titleService.setTitle(`${this.title} | ${this.defaultTitle}`);
}
} else {
this.titleService.setTitle(this.defaultTitle);
}
Expand Down

0 comments on commit 6c9658f

Please sign in to comment.