forked from OnsenUI/playground
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton.html
More file actions
68 lines (56 loc) · 1.35 KB
/
Copy pathbutton.html
File metadata and controls
68 lines (56 loc) · 1.35 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
<!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';
declare var alert: Function;
@Component({
selector: 'app',
template: `
<ons-page>
<ons-toolbar>
<div class="center">Button Example</div>
</ons-toolbar>
<div class="background"></div>
<div class="content">
<div style="text-align: center; margin: 10px;">
<ons-button (click)="onClick()">MyButton</ons-button>
</div>
</div>
</ons-page>
`
})
export class AppComponent {
constructor() {
}
onClick() {
ons.notification.alert('Clicked!');
}
}
@NgModule({
imports: [OnsenModule],
declarations: [AppComponent],
bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
class AppModule { }
platformBrowserDynamic().bootstrapModule(AppModule);
</script>
</head>
<body>
<app></app>
</body>
</html>
<!-- info
## Button
`ons-button` element renders a button. Please refer to [ons-button element Reference](https://onsen.io/v2/docs/angular2/ons-button.html) for more details.
Tutorial contents will be added soon.
-->