File tree Expand file tree Collapse file tree 2 files changed +93
-0
lines changed Expand file tree Collapse file tree 2 files changed +93
-0
lines changed Original file line number Diff line number Diff line change
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 { }
Original file line number Diff line number Diff line change
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 > <ion-icon name="logo-apple" hideWhen="android,windows"></ion-icon> </ 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 > <ion-icon name="logo-android" hideWhen="ios,windows"></ion-icon> </ 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 > <ion-icon name="logo-windows" hideWhen="ios,android"></ion-icon> </ 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 >
You can’t perform that action at this time.
0 commit comments