質問編集履歴

1

index.htmlを掲載した。

2018/11/19 15:30

投稿

Drthomas
Drthomas

スコア17

test CHANGED
File without changes
test CHANGED
@@ -167,3 +167,291 @@
167
167
 
168
168
 
169
169
  どうかご回答の程よろしくお願いいたします。
170
+
171
+
172
+
173
+ index.htmlが必要とのことなので載せておきます。よろしくお願いいたします。
174
+
175
+ ```html
176
+
177
+ <!DOCTYPE HTML>
178
+
179
+ <html>
180
+
181
+ <head>
182
+
183
+ <meta charset="utf-8">
184
+
185
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
186
+
187
+ <meta http-equiv="Content-Security-Policy" content="default-src * data: gap: https://ssl.gstatic.com; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'">
188
+
189
+ <script src="components/loader.js"></script>
190
+
191
+ <script src="lib/angular/angular.min.js"></script>
192
+
193
+ <script src="lib/onsenui/js/onsenui.min.js"></script>
194
+
195
+ <script src="lib/onsenui/js/angular-onsenui.min.js"></script>
196
+
197
+
198
+
199
+ <link rel="stylesheet" href="components/loader.css">
200
+
201
+ <link rel="stylesheet" href="lib/onsenui/css/onsenui.css">
202
+
203
+ <link rel="stylesheet" href="lib/onsenui/css/onsen-css-components.css">
204
+
205
+ <link rel="stylesheet" href="css/style.css">
206
+
207
+
208
+
209
+ <script>
210
+
211
+ ons.bootstrap()
212
+
213
+ //左上のページを変える処理
214
+
215
+ .controller('AppController', function($scope) {
216
+
217
+ this.load = function(page) {
218
+
219
+ $scope.splitter.content.load(page);
220
+
221
+ $scope.splitter.left.close();
222
+
223
+ };
224
+
225
+ this.toggle = function() {
226
+
227
+ $scope.splitter.left.toggle();
228
+
229
+ };
230
+
231
+ })
232
+
233
+ //ダイアログを開く処理
234
+
235
+ .controller('DialogController', function($scope) {
236
+
237
+ this.button="button";
238
+
239
+ this.show = function(dlg) {
240
+
241
+ ons.createDialog(dlg).then(function(dialog) {
242
+
243
+ dialog.show();
244
+
245
+ });
246
+
247
+ }
248
+
249
+ })
250
+
251
+ //リストを選んだときの処理
252
+
253
+ .controller('listController', function($scope) {
254
+
255
+ this.output = function(key){
256
+
257
+ dialog.hide();
258
+
259
+ keyword=key;
260
+
261
+ console.log(keyword);
262
+
263
+ }
264
+
265
+ });
266
+
267
+ ons.ready(function() {
268
+
269
+ console.log("Onsen UI is ready!");
270
+
271
+ });
272
+
273
+ </script>
274
+
275
+ </head>
276
+
277
+ <body>
278
+
279
+
280
+
281
+ <ons-splitter ng-controller="AppController as app" var="splitter">
282
+
283
+ <ons-splitter-side side="left" width="220px" collapse swipeable>
284
+
285
+ <ons-page>
286
+
287
+ <ons-list>
288
+
289
+ <ons-list-item ng-click="app.load('home.html')" tappable>
290
+
291
+ Home
292
+
293
+ </ons-list-item>
294
+
295
+ <ons-list-item ng-click="app.load('settings.html')" tappable>
296
+
297
+ Settings
298
+
299
+ </ons-list-item>
300
+
301
+ <ons-list-item ng-click="app.load('about.html')" tappable>
302
+
303
+ About
304
+
305
+ </ons-list-item>
306
+
307
+ </ons-list>
308
+
309
+ </ons-page>
310
+
311
+ </ons-splitter-side>
312
+
313
+ <ons-splitter-content page="home.html"></ons-splitter-content>
314
+
315
+ </ons-splitter>
316
+
317
+
318
+
319
+ <ons-template id="home.html">
320
+
321
+ <ons-page>
322
+
323
+ <ons-toolbar>
324
+
325
+ <div class="left">
326
+
327
+ <ons-toolbar-button ng-click="app.toggle()">
328
+
329
+ <ons-icon icon="md-menu"></ons-icon>
330
+
331
+ </ons-toolbar-button>
332
+
333
+ </div>
334
+
335
+ <div class="center">
336
+
337
+ Main
338
+
339
+ </div>
340
+
341
+ </ons-toolbar>
342
+
343
+ <div ng-controller="DialogController as dlgc">
344
+
345
+ <ons-button ng-click="dlgc.show('button.html')" id="btn1">button1</ons-button>
346
+
347
+ </div>
348
+
349
+ </ons-page>
350
+
351
+ </ons-template>
352
+
353
+
354
+
355
+ <ons-template id="settings.html">
356
+
357
+ <ons-page>
358
+
359
+ <ons-toolbar>
360
+
361
+ <div class="left">
362
+
363
+ <ons-toolbar-button ng-click="app.toggle()">
364
+
365
+ <ons-icon icon="md-menu"></ons-icon>
366
+
367
+ </ons-toolbar-button>
368
+
369
+ </div>
370
+
371
+ <div class="center">
372
+
373
+ Settings
374
+
375
+ </div>
376
+
377
+ </ons-toolbar>
378
+
379
+ </ons-page>
380
+
381
+ </ons-template>
382
+
383
+
384
+
385
+ <ons-template id="about.html">
386
+
387
+ <ons-page>
388
+
389
+ <ons-toolbar>
390
+
391
+ <div class="left">
392
+
393
+ <ons-toolbar-button ng-click="app.toggle()">
394
+
395
+ <ons-icon icon="md-menu"></ons-icon>
396
+
397
+ </ons-toolbar-button>
398
+
399
+ </div>
400
+
401
+ <div class="center">
402
+
403
+ About
404
+
405
+ </div>
406
+
407
+ </ons-toolbar>
408
+
409
+ </ons-page>
410
+
411
+ </ons-template>
412
+
413
+
414
+
415
+ <ons-template id="button.html">
416
+
417
+ <ons-dialog var="dialog" modifier="material" cancelable>
418
+
419
+ <div class="dialog-container" style="height: 200px;">
420
+
421
+ <ons-page>
422
+
423
+ <ons-toolbar>
424
+
425
+ <div class="center">
426
+
427
+ <div ng-controller="DialogController as dlgc" ng-cloak>
428
+
429
+ <span ng-bind="dlgc.button"></span>
430
+
431
+ </div>
432
+
433
+ </div>
434
+
435
+ </ons-toolbar>
436
+
437
+ <ons-list ng-controller="listController as lstc">
438
+
439
+ <ons-list-item ng-click="lstc.output('1')" modifier="tappable">
440
+
441
+ リストを押した
442
+
443
+ </ons-list-item>
444
+
445
+ </ons-list>
446
+
447
+ </ons-page>
448
+
449
+ </div>
450
+
451
+ </ons-dialog>
452
+
453
+ </body>
454
+
455
+ </html>
456
+
457
+ ```