Skip to content

Commit 2f074b4

Browse files
committed
docs(hide-when): add hide-when demo back
1 parent 4224e90 commit 2f074b4

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed

demos/src/hide-when/app.module.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Component, NgModule } from '@angular/core';
2+
import { IonicApp, IonicModule } from '../../ionic-angular';
3+
4+
5+
@Component({
6+
templateUrl: 'page.html'
7+
})
8+
export class ApiDemoPage {}
9+
10+
11+
@Component({
12+
template: '<ion-nav [root]="root"></ion-nav>'
13+
})
14+
export class ApiDemoApp {
15+
root = ApiDemoPage;
16+
}
17+
18+
19+
@NgModule({
20+
declarations: [
21+
ApiDemoApp,
22+
ApiDemoPage
23+
],
24+
imports: [
25+
IonicModule.forRoot(ApiDemoApp)
26+
],
27+
bootstrap: [IonicApp],
28+
entryComponents: [
29+
ApiDemoPage
30+
]
31+
})
32+
export class AppModule {}

demos/src/hide-when/page.html

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<ion-header>
2+
3+
<ion-navbar>
4+
<ion-title>HideWhen</ion-title>
5+
</ion-navbar>
6+
7+
</ion-header>
8+
9+
10+
<ion-content class="hide-when-demo">
11+
12+
<h5 margin>Hide Icon Per Platform</h5>
13+
<p margin>In this example we're using the <code>hideWhen</code> directive to decide whether to hide an icon based on the platform.</p>
14+
15+
<ion-grid>
16+
<ion-row>
17+
<ion-col text-center>
18+
<ion-icon name="logo-apple" hideWhen="android,windows"></ion-icon>
19+
</ion-col>
20+
<ion-col>
21+
<code> &lt;ion-icon name="logo-apple" hideWhen="android,windows"&gt;&lt;/ion-icon&gt; </code>
22+
</ion-col>
23+
</ion-row>
24+
<ion-row>
25+
<ion-col text-center>
26+
<ion-icon name="logo-android" hideWhen="ios,windows"></ion-icon>
27+
</ion-col>
28+
<ion-col>
29+
<code> &lt;ion-icon name="logo-android" hideWhen="ios,windows"&gt;&lt;/ion-icon&gt; </code>
30+
</ion-col>
31+
</ion-row>
32+
<ion-row>
33+
<ion-col text-center>
34+
<ion-icon name="logo-windows" hideWhen="ios,android"></ion-icon>
35+
</ion-col>
36+
<ion-col>
37+
<code> &lt;ion-icon name="logo-windows" hideWhen="ios,android"&gt;&lt;/ion-icon&gt; </code>
38+
</ion-col>
39+
</ion-row>
40+
</ion-grid>
41+
42+
</ion-content>
43+
44+
<style>
45+
.hide-when-demo ion-col {
46+
background: #f8f8f8;
47+
border: 1px solid #ddd;
48+
margin: 1%;
49+
max-width: 48%;
50+
flex: 0 0 48%;
51+
min-height: 120px;
52+
}
53+
54+
.hide-when-demo code {
55+
background: #f8f8f8;
56+
}
57+
58+
.hide-when-demo ion-icon {
59+
font-size: 100px;
60+
}
61+
</style>

0 commit comments

Comments
 (0)