forked from krescruz/angular-materialize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
238 lines (221 loc) · 11.3 KB
/
index.html
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0">
<title>Angularjs directives for Materialize CSS Framework</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.95.3/css/materialize.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/0.0.1/prism.min.css">
<link rel="stylesheet" href="css/style.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/prism/0.0.1/prism.min.js"></script>
<!-- TODO: This version contains a bug with adjusting height in textarea's. Update when possible -->
<script src="//cdnjs.cloudflare.com/ajax/libs/materialize/0.95.3/js/materialize.js"></script>
<script type="text/javascript" src="src/angular-materialize.js"></script>
<!-- App -->
<script type="text/javascript" src="js/app.js"></script>
</head>
<body ng-app="materializeApp" ng-controller="BodyController">
<header>
<div class="container"><a href="#" data-activates="nav-mobile" class="button-collapse top-nav" data-sidenav="left" data-closeonclick="false"><i
class="mdi-navigation-menu"></i></a></div>
<ul id="nav-mobile" class="side-nav fixed">
<!--Maybe a logo?-->
<!--<li class="logo" style="margin-left: -15px;"><a id="logo-container" href="http://materializecss.com/"class="brand-logo"><h3></h3></a></li>-->
<li class="bold"><a href="http://materializecss.com/" class="waves-effect waves-teal">Materialize</a></li>
<li class="bold"><a href="https://angularjs.org/" class="waves-effect waves-teal">AngularJS</a></li>
<li class="no-padding">
<ul class="collapsible collapsible-accordion">
<li class="bold"><a class="collapsible-header waves-effect waves-teal active">Forms</a>
<div class="collapsible-body">
<ul>
<li><a href="#input-field">Input-field</a></li>
<li><a href="#select">Material select</a></li>
</ul>
</div>
</li>
</ul>
</li>
<li class="no-padding">
<ul class="collapsible collapsible-accordion">
<li class="bold"><a class="collapsible-header waves-effect waves-teal active">JavaScript</a>
<div class="collapsible-body">
<ul>
<li><a href="#toast">Dialogs - Toast</a></li>
<li><a href="#dropdown">Dropdown</a></li>
<li><a href="#sidenav">SideNav</a></li>
</ul>
</div>
</li>
</ul>
</li>
</ul>
</header>
<main>
<div class="section" id="index-banner">
<div class="container">
<div class="row">
<div class="col s12">
<h1 class="header center-on-small-only"><a href="https://github.com/webbiesdk/angular-materialize" style="color:white;">Angular-materialize</a></h1>
<p style="color: white;" class="center-on-small-only">This is a collection of simple angular directives for using the features in <a href="http://materializecss.com">materializecss</a>. </p>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row" id="input-field">
<h2 class="header">Input-field</h2>
<p>Materialize uses the class .input-field to manage animating labels and input-fields. But that doesn't work properly when angular dynamically creates element</p>
<p>Instead of adding the class input-field, use the input-field directive. This way it still works when angular dynamically
creates it.</p>
</div>
<div class="row" ng-init="showInputLabel = true;dummyInputs.inputFieldInput = 'This is input'">
<div class="col s2">
<a class="btn waves-effect waves-light" ng-click="showInputLabel = !showInputLabel">Toggle input</a>
</div>
<div class="col s4">
<div></div>
<div ng-if="showInputLabel" input-field>
<input type="text" ng-model="dummyInputs.inputFieldInput">
<label>Input label</label>
</div>
</div>
</div>
<div class="row">
<pre><code class="language-markup" ng-non-bindable>
<div input-field>
<input type="text" ng-model="dummyInputs.inputFieldInput">
<label>Input label</label>
</div></code></pre>
</div>
<div class="row">
<p>You can also use it as an element instead of an attribute.</p>
<pre><code class="language-markup" ng-non-bindable>
<input-field>
<input type="text" ng-model="dummyInputs.inputFieldInput">
<label>Input label</label>
</input-field></code></pre>
</div>
<div class="row" id="select">
<h2 class="header">Material select</h2>
<p>Add the material-select as an attribute to the select where you want material-select.</p>
<p>Not needed if you add the class browser-default.</p>
<p>It doesn't support changing content within the select, add the class browser-default if you want that.</p>
</div>
<div class="row">
<div class="section col s4">
<select class="" ng-model="select.value1" material-select>
<option ng-repeat="value in select.choices">{{value}}</option>
</select>
</div>
<div class="section col s4">
<h5>You selected: <b>{{select.value1}}</b></h5>
</div>
</div>
<div class="row">
<pre><code class="language-markup" ng-non-bindable>
<select class="" ng-model="select.value1" material-select>
<option ng-repeat="value in select.choices">{{value}}</option>
</select></code></pre>
</div>
<div class="row">
<h5>Using class browser-default</h5>
<div class="section col s4">
<select class="browser-default" ng-model="select.value2">
<option ng-repeat="value in select.choices">{{value}}</option>
</select>
</div>
<div class="section col s4">
<h5>You selected: <b>{{select.value2}}</b></h5>
</div>
</div>
<div class="row">
<pre><code class="language-markup" ng-non-bindable>
<select class="browser-default" ng-model="select.value2">
<option ng-repeat="value in select.choices">{{value}}</option>
</select></code></pre>
</div>
<div class="row" id="toast">
<h2 class="header">Toasts</h2>
<p>Materializes toast is a global function. Using this directive you can call a toast using a custom event (in the below click), and show a message determined by a variable in the scope.</p>
</div>
<div class="row">
<div class="col s4" input-field>
<input id="message" type="text" ng-model="dummyInputs.message">
<label for="message">Message</label>
</div>
<div class="input-field col s4">
<a class="waves-effect waves-light btn" data-message="{{ dummyInputs.message }}" toast='click'>Toast!</a>
</div>
</div>
<div class="row">
<pre><code class="language-markup" ng-non-bindable>
<div class="row">
<div class="col s4" input-field>
<input id="message" type="text" ng-model="dummyInputs.message">
<label for="message">Message</label>
</div>
<div class="input-field col s4">
<a class="waves-effect waves-light btn" data-message="{{ dummyInputs.message }}" toast='click'>Toast!</a>
</div>
</div></code></pre>
</div>
<div class="row" id="dropdown">
<h2 class="header">Dropdown</h2>
<p>The dropdown attribute in the below makes sure that the jQuery plugin is run.</p>
<p>You can set attributes on the tag, matching the names of the options in the <a href="http://materializecss.com/dropdown.html#!">materializeCSS's version</a>.</p>
</div>
<div class="row">
<div class="section col s4">
<!-- Dropdown Trigger -->
<a class='dropdown-button btn' href='javascript:void(0);' data-activates='demoDropdown' dropdown data-hover="true">
This is a dropdown
</a>
<!-- Dropdown Structure -->
<ul id='demoDropdown' class='dropdown-content'>
<li><a href="javascript:void(0);">Link 1</a></li>
<li><a href="javascript:void(0);">Link 2</a></li>
<li><a href="javascript:void(0);">Link 3</a></li>
<li><a href="javascript:void(0);">Link 4</a></li>
<li><a href="javascript:void(0);">Link 5</a></li>
</ul>
</div>
</div>
<div class="row">
<pre><code class="language-markup" ng-non-bindable>
<!-- Dropdown Trigger -->
<a class='dropdown-button btn' href='javascript:void(0);' data-activates='demoDropdown' dropdown data-hover="true">
This is a dropdown
</a>
<!-- Dropdown Structure -->
<ul id='demoDropdown' class='dropdown-content'>
<li><a href="javascript:void(0);">Link 1</a></li>
<li><a href="javascript:void(0);">Link 2</a></li>
<li><a href="javascript:void(0);">Link 3</a></li>
<li><a href="javascript:void(0);">Link 4</a></li>
<li><a href="javascript:void(0);">Link 5</a></li>
</ul></code></pre>
</div>
<div class="row" id="sidenav">
<h2 class="header">Sidenav</h2>
<p>Make sure to have a side-menu with id corresponding to the argument <code class="language-markup">data-activates</code>. </p>
<p>If you copy this page, there is another side-nav link in the top of the page, which initializes first and therefore sets the options. </p>
<p>If you add the class <code class="language-markup">button-collapse</code> the button will only show when the side-menu is hidden. <br/>
This is not done on the below button, for demonstration purposes, although it is added in the code example.</p>
</div>
<div class="row">
<a href="#" data-activates="nav-mobile" class="top-nav btn waves-effect waves-light" data-sidenav="left" data-closeonclick="false">
Show side-nav
</a>
</div>
<div class="row">
<pre><code class="language-markup" ng-non-bindable>
<a href="#" class="button-collapse" data-activates="nav-mobile" data-sidenav="left" data-menuwidth="500" data-closeonclick="false">
Show side-nav
</a></code></pre>
</div>
</div>
</main>
</body>
</html>