forked from OnsenUI/playground
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconditional.html
More file actions
77 lines (63 loc) · 1.71 KB
/
Copy pathconditional.html
File metadata and controls
77 lines (63 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Onsen UI App</title>
<script type="text/typescript">
import {
Component,
OnsenModule,
NgModule,
CUSTOM_ELEMENTS_SCHEMA
} from 'angular2-onsenui';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
@Component({
selector: 'app',
styles: [`
.box {
margin: 10px auto;
width: 280px;
max-width: 90%;
padding: 8px;
color: gray;
border: 1px solid #ccc;
text-align: center;
display: block;
}
`],
template: `
<ons-page>
<ons-toolbar>
<div class="center">ons-if</div>
</ons-toolbar>
<div class="background"></div>
<div class="content">
<ons-if class="box" orientation="portrait">ons-if orientation=portrait</ons-if>
<ons-if class="box" orientation="landscape">ons-if orientation=landscape</ons-if>
<ons-if class="box" platform="chrome">ons-if platform=chrome</ons-if>
<ons-if class="box" platform="android">ons-if platform=android</ons-if>
<ons-if class="box" platform="ios">ons-if platform=ios</ons-if>
</div>
</ons-page>
`
})
export class AppComponent {
}
@NgModule({
imports: [OnsenModule],
declarations: [AppComponent],
bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
class AppModule { }
platformBrowserDynamic().bootstrapModule(AppModule);
</script>
</head>
<body>
<app></app>
</body>
</html>
<!-- info
## Conditional(ons-if)
Tutorial contents will be added soon.
-->