docs(demos): add title demo which uses the toolbar demo but hides some

Hiding any toolbars that don’t use ion-title for the title demo only

references driftyco/ionic-site#397
This commit is contained in:
Brandy Carney
2016-02-05 12:17:53 -05:00
parent 03b5ff583e
commit 78c2ecc84f
3 changed files with 20 additions and 5 deletions

15
demos/title/index.ts Normal file
View File

@ -0,0 +1,15 @@
import {App} from 'ionic/ionic';
// Use the toolbar demo but pass in the demo name to change the title
// this will also hide some of the toolbars that don't use `ion-title`
@App({
templateUrl: '../toolbar/main.html'
})
class ApiDemoApp {
constructor() {
this.demo = "Title";
this.favorites = "recent";
this.apps = "free";
}
}

View File

@ -93,7 +93,7 @@
</button>
</ion-toolbar>
<ion-toolbar>
<ion-toolbar *ngIf="demo != 'Title'">
<ion-buttons end>
<button #button2 (click)="buttonClick(button2)">
<ion-icon name="search"></ion-icon>
@ -109,7 +109,7 @@
</ion-segment>
</ion-toolbar>
<ion-toolbar>
<ion-toolbar *ngIf="demo != 'Title'">
<ion-segment [(ngModel)]="apps">
<ion-segment-button value="paid">
Paid
@ -123,11 +123,11 @@
</ion-segment>
</ion-toolbar>
<ion-toolbar>
<ion-toolbar *ngIf="demo != 'Title'">
<ion-searchbar></ion-searchbar>
</ion-toolbar>
<ion-toolbar primary>
<ion-toolbar primary *ngIf="demo != 'Title'">
<ion-searchbar></ion-searchbar>
</ion-toolbar>

View File

@ -136,7 +136,7 @@ export class Toolbar extends ToolbarBase {
* <ion-title>SubHeader</ion-title>
* </ion-toolbar>
* ```
* @demo /docs/v2/demos/toolbar/
* @demo /docs/v2/demos/title/
*/
@Component({
selector: 'ion-title',