質問編集履歴

3

ソースをまとめました

2017/12/21 08:04

投稿

shori0128
shori0128

スコア29

test CHANGED
File without changes
test CHANGED
@@ -1,11 +1,5 @@
1
1
  ###前提・実現したいこと
2
2
 
3
- ※文字数の関係でhtml部分が非常に見づらく極一部の抜粋になっています。
4
-
5
- 申し訳ありません。
6
-
7
-
8
-
9
3
  monacaでonsenui+angularjs1でandroidアプリの開発をしております。
10
4
 
11
5
  以下に記述するソースで$scope.$apply()でリストが更新されません。
@@ -36,20 +30,6 @@
36
30
 
37
31
  ```javascript
38
32
 
39
- const kijiFolder = 'kiji';
40
-
41
- const pageOption = {
42
-
43
- animation: 'slide'
44
-
45
- };
46
-
47
-
48
-
49
- let appDir, kijiDir, sql;
50
-
51
-
52
-
53
33
  ons.bootstrap()
54
34
 
55
35
  .factory('sharedScope', function ($rootScope) {
@@ -90,175 +70,265 @@
90
70
 
91
71
  .then(function () {
92
72
 
93
- if (!appDir) return resolveLocalFileSystemURLSync(cordova.file.dataDirectory);
73
+ return db.select(sql);
94
74
 
95
75
  })
96
76
 
97
- .then(function (fs) {
77
+ .then(function (result) {
98
-
78
+
99
- if (fs) appDir = fs;
79
+ let localItem = [];
100
-
80
+
101
- if (!kijiDir) return getDirectorySync(appDir, kijiFolder);
81
+ result.forEach(function (record, index) {
82
+
83
+ localItem.push({
84
+
85
+ key: record.XML_PATH,
86
+
87
+ xmlPath: path(kijiDir.nativeURL, record.XML_PATH),
88
+
89
+ imagePath: '',
90
+
91
+ thumbPath: '',
92
+
93
+ title: record.TITLE,
94
+
95
+ honbun: record.HONBUN,
96
+
97
+ category: record.CATEGORY,
98
+
99
+ author: record.AUTHOR,
100
+
101
+ sendFlg: record.SEND_FLG,
102
+
103
+ updateDate: record.UPDATE_DATE
104
+
105
+ });
106
+
107
+ });
108
+
109
+ $scope.item = localItem;
110
+
111
+ $scope.$apply();
102
112
 
103
113
  })
104
114
 
105
- .then(function (fs) {
106
-
107
- if (fs) kijiDir = fs;
108
-
109
-
110
-
111
- sql = " SELECT";
112
-
113
- sql += " XML_PATH";
114
-
115
- sql += " ,TITLE";
116
-
117
- sql += " ,HONBUN";
118
-
119
- sql += " ,CATEGORY";
120
-
121
- sql += " ,AUTHOR";
122
-
123
- sql += " ,SEND_FLG";
124
-
125
- sql += " ,UPDATE_DATE";
126
-
127
- sql += " FROM";
128
-
129
- sql += " M_FILE_INFO";
130
-
131
- sql += " WHERE";
132
-
133
- sql += " KG_KBN = '1'";
134
-
135
- sql += " ORDER BY";
136
-
137
- sql += " UPDATE_DATE DESC";
138
-
139
-
140
-
141
- const db = new DB();
142
-
143
-
144
-
145
- db.open();
146
-
147
-
148
-
149
- return db.select(sql);
150
-
151
- })
152
-
153
- .then(function (result) {
154
-
155
- let localItem = [];
156
-
157
- result.forEach(function (record, index) {
158
-
159
- localItem.push({
160
-
161
- key: record.XML_PATH,
162
-
163
- xmlPath: path(kijiDir.nativeURL, record.XML_PATH),
164
-
165
- imagePath: '',
166
-
167
- thumbPath: '',
168
-
169
- title: record.TITLE,
170
-
171
- honbun: record.HONBUN,
172
-
173
- category: record.CATEGORY,
174
-
175
- author: record.AUTHOR,
176
-
177
- sendFlg: record.SEND_FLG,
178
-
179
- updateDate: record.UPDATE_DATE
180
-
181
- });
115
+ .catch(getErr);
116
+
117
+ };
118
+
119
+
120
+
121
+ //■ 起動時
122
+
123
+ ons.ready(function () {
124
+
125
+ sharedScope.setScope('reloadKiji', {
126
+
127
+ reload: function () {
128
+
129
+ showKiji();
130
+
131
+ }
132
+
133
+ });
134
+
135
+ showKiji();
136
+
137
+ });
138
+
139
+
140
+
141
+ $scope.delegate = {
142
+
143
+ configureItemScope: function (index, itemScope) {
144
+
145
+ itemScope.item = {
146
+
147
+ key: $scope.item[index].key,
148
+
149
+ xmlPath: $scope.item[index].xmlPath,
150
+
151
+ imagePath: $scope.item[index].imagePath,
152
+
153
+ thumbPath: $scope.item[index].thumbPath,
154
+
155
+ title: $scope.item[index].title != '' ? $scope.item[index].title : '(無題)',
156
+
157
+ honbun: $scope.item[index].honbun,
158
+
159
+ category: $scope.item[index].category,
160
+
161
+ author: $scope.item[index].author,
162
+
163
+ sendFlg: $scope.item[index].sendFlg,
164
+
165
+ updateDate: $scope.item[index].updateDate
166
+
167
+ };
168
+
169
+ },
170
+
171
+ calculateItemHeight: function (index) {
172
+
173
+ return 91;
174
+
175
+ },
176
+
177
+ countItems: function () {
178
+
179
+ return $scope.item.length;
180
+
181
+ }
182
+
183
+ };
184
+
185
+
186
+
187
+ //■ 記事編集画面オープン
188
+
189
+ $scope.openEditor = function (index) {
190
+
191
+ sharedScope.setScope('kijiEditCtrl', {
192
+
193
+ key: $scope.item[index].key,
194
+
195
+ xmlPath: $scope.item[index].xmlPath,
196
+
197
+ imagePath: $scope.item[index].imagePath,
198
+
199
+ thumbPath: $scope.item[index].thumbPath,
200
+
201
+ title: $scope.item[index].title,
202
+
203
+ honbun: $scope.item[index].honbun,
204
+
205
+ category: $scope.item[index].category,
206
+
207
+ author: $scope.item[index].author,
208
+
209
+ sendFlg: $scope.item[index].sendFlg,
210
+
211
+ updateDate: $scope.item[index].updateDate
212
+
213
+ });
214
+
215
+
216
+
217
+ tabNavi1.pushPage('kijiEdit.html', pageOption);
218
+
219
+ };
220
+
221
+ })
222
+
223
+ .controller('kijiEditCtrl', function ($scope, $rootScope, sharedScope) {
224
+
225
+ //■ 画面ロード時
226
+
227
+ $scope.getData = function (event) {
228
+
229
+ //~データ取得した内容を画面に反映~
230
+
231
+ };
232
+
233
+
234
+
235
+ //■ 保存処理
236
+
237
+ const saveProcess = function (xml) {
238
+
239
+ const db = new DB();
240
+
241
+
242
+
243
+ db.open();
244
+
245
+
246
+
247
+ const title = (isDefined($scope.title)) ? $scope.title : '';
248
+
249
+ const honbun = (isDefined($scope.honbun)) ? $scope.honbun : '';
250
+
251
+ const category = (isDefined($scope.category)) ? $scope.category : '';
252
+
253
+ const author = (isDefined($scope.author)) ? $scope.author : '';
254
+
255
+ const now = formatDate(new Date());
256
+
257
+
258
+
259
+ if (isDefined(xml)) {
260
+
261
+ //~データの更新処理~
262
+
263
+ db.update(sql)
264
+
265
+ .then(function (result) {
266
+
267
+ if (result === true) {
268
+
269
+ sharedScope.getScope('reloadKiji').reload();
270
+
271
+ }
272
+
273
+ })
274
+
275
+ .catch(function (err) {
276
+
277
+ window.alert(err);
278
+
279
+ console.log(err);
182
280
 
183
281
  });
184
282
 
185
- $scope.item = localItem;
186
-
187
- $scope.$apply();
188
-
189
- })
190
-
191
- .catch(function (err) {
192
-
193
- window.alert(err);
194
-
195
- console.log(err);
196
-
197
- });
198
-
199
- };
200
-
201
-
202
-
203
- //■ 起動時
204
-
205
- ons.ready(function () {
206
-
207
- sharedScope.setScope('reloadKiji', {
208
-
209
- reload: function () {
210
-
211
- showKiji();
212
-
213
- }
214
-
215
- });
216
-
217
- showKiji();
218
-
219
- });
220
-
221
-
222
-
223
- $scope.delegate = {
224
-
225
- configureItemScope: function (index, itemScope) {
226
-
227
- itemScope.item = {
228
-
229
- key: $scope.item[index].key,
230
-
231
- xmlPath: $scope.item[index].xmlPath,
232
-
233
- imagePath: $scope.item[index].imagePath,
234
-
235
- thumbPath: $scope.item[index].thumbPath,
236
-
237
- title: $scope.item[index].title != '' ? $scope.item[index].title : '(無題)',
238
-
239
- honbun: $scope.item[index].honbun,
240
-
241
- category: $scope.item[index].category,
242
-
243
- author: $scope.item[index].author,
244
-
245
- sendFlg: $scope.item[index].sendFlg,
246
-
247
- updateDate: $scope.item[index].updateDate
248
-
249
- };
250
-
251
- },
252
-
253
- calculateItemHeight: function (index) {
254
-
255
- return 91;
256
-
257
- },
258
-
259
- countItems: function () {
260
-
261
- return $scope.item.length;
283
+ } else {
284
+
285
+ //新規処理
286
+
287
+ xml = 'SCM_K_' + formatDateStr(new Date()) + '_' + createRandomStr() + '.xml';
288
+
289
+
290
+
291
+ //~データの挿入処理~
292
+
293
+
294
+
295
+ db.insert(sql)
296
+
297
+ .then(function (result) {
298
+
299
+ if (result === true) {
300
+
301
+ sharedScope.setScope('kijiEditCtrl', {
302
+
303
+ key: xml,
304
+
305
+ xmlPath: path(kijiDir.nativeURL, xml),
306
+
307
+ imagePath: '',
308
+
309
+ thumbPath: '',
310
+
311
+ title: title,
312
+
313
+ honbun: honbun,
314
+
315
+ category: category,
316
+
317
+ author: author,
318
+
319
+ sendFlg: null,
320
+
321
+ updateDate: now
322
+
323
+ });
324
+
325
+ sharedScope.getScope('reloadKiji').reload();
326
+
327
+ }
328
+
329
+ })
330
+
331
+ .catch(getErr);
262
332
 
263
333
  }
264
334
 
@@ -266,329 +336,159 @@
266
336
 
267
337
 
268
338
 
269
- //■ 記事編集画面オープン
339
+ //■ 上書保存
270
-
340
+
271
- $scope.openEditor = function (index) {
341
+ $scope.overWriteFile = function () {
272
-
342
+
273
- sharedScope.setScope('kijiEditCtrl', {
343
+ const data = sharedScope.getScope('kijiEditCtrl')
274
-
275
- key: $scope.item[index].key,
344
+
276
-
277
- xmlPath: $scope.item[index].xmlPath,
278
-
279
- imagePath: $scope.item[index].imagePath,
280
-
281
- thumbPath: $scope.item[index].thumbPath,
282
-
283
- title: $scope.item[index].title,
284
-
285
- honbun: $scope.item[index].honbun,
286
-
287
- category: $scope.item[index].category,
288
-
289
- author: $scope.item[index].author,
290
-
291
- sendFlg: $scope.item[index].sendFlg,
292
-
293
- updateDate: $scope.item[index].updateDate
345
+ const xml = (isDefined(data.key)) ? data.key : undefined;
346
+
294
-
347
+ saveProcess(xml);
348
+
295
- });
349
+ };
350
+
351
+
352
+
296
-
353
+ //■ 別名保存
297
-
298
-
354
+
299
- tabNavi1.pushPage('kijiEdit.html', pageOption);
355
+ $scope.createFile = function () {
356
+
357
+ saveProcess();
300
358
 
301
359
  };
302
360
 
303
361
  })
304
362
 
305
- .controller('kijiEditCtrl', function ($scope, $rootScope, sharedScope) {
306
-
307
- //■ 画面ロード時
308
-
309
- $scope.getData = function (event) {
310
-
311
- const data = sharedScope.getScope('kijiEditCtrl')
312
-
313
-
314
-
315
- if (isDefined(data)) {
316
-
317
- $scope.key = data.key;
318
-
319
- $scope.xmlPath = data.xmlPath;
320
-
321
- $scope.imagePath = data.imagePath;
322
-
323
- $scope.thumbPath = data.thumbPath;
324
-
325
- $scope.title = data.title;
326
-
327
- $scope.honbun = data.honbun;
328
-
329
- $scope.category = data.category;
330
-
331
- $scope.author = data.author;
332
-
333
- $scope.sendFlg = data.sendFlg;
334
-
335
- $scope.updateDate = data.updateDate;
336
-
337
- $scope.$apply();
338
-
339
- }
340
-
341
- };
342
-
343
-
344
-
345
- //■ 保存処理
346
-
347
- const saveProcess = function (xml) {
348
-
349
- const db = new DB();
350
-
351
-
352
-
353
- db.open();
354
-
355
-
356
-
357
- const title = (isDefined($scope.title)) ? $scope.title : '';
358
-
359
- const honbun = (isDefined($scope.honbun)) ? $scope.honbun : '';
360
-
361
- const category = (isDefined($scope.category)) ? $scope.category : '';
362
-
363
- const author = (isDefined($scope.author)) ? $scope.author : '';
364
-
365
- const now = formatDate(new Date());
366
-
367
-
368
-
369
- if (isDefined(xml)) {
370
-
371
- //更新処理
372
-
373
- sql = " UPDATE M_FILE_INFO SET";
374
-
375
- sql += " TITLE = '" + title + "'";
376
-
377
- sql += " ,HONBUN = '" + honbun + "'";
378
-
379
- sql += " ,CATEGORY = '" + category + "'";
380
-
381
- sql += " ,AUTHOR = '" + author + "'";
382
-
383
- sql += " ,UPDATE_DATE = '" + now + "'";
384
-
385
- sql += " WHERE";
386
-
387
- sql += " XML_PATH = '" + xml + "' AND";
388
-
389
- sql += " KG_KBN = '1'";
390
-
391
-
392
-
393
- db.update(sql)
394
-
395
- .then(function (result) {
396
-
397
- if (result === true) {
398
-
399
- sharedScope.getScope('reloadKiji').reload();
400
-
401
- }
402
-
403
- })
404
-
405
- .catch(function (err) {
406
-
407
- window.alert(err);
408
-
409
- console.log(err);
410
-
411
- });
412
-
413
- } else {
414
-
415
- //新規処理
416
-
417
- xml = 'SCM_K_' + formatDateStr(new Date()) + '_' + createRandomStr() + '.xml';
418
-
419
-
420
-
421
- sql = " INSERT INTO M_FILE_INFO (";
422
-
423
- sql += " XML_PATH";
424
-
425
- sql += " ,IMAGE_PATH";
426
-
427
- sql += " ,THUMB_PATH";
428
-
429
- sql += " ,KG_KBN";
430
-
431
- sql += " ,TITLE";
432
-
433
- sql += " ,HONBUN";
434
-
435
- sql += " ,CATEGORY";
436
-
437
- sql += " ,AUTHOR";
438
-
439
- sql += " ,INSERT_DATE";
440
-
441
- sql += " ,UPDATE_DATE";
442
-
443
- sql += " ) VALUES (";
444
-
445
- sql += " '" + xml + "'";
446
-
447
- sql += " ,''";
448
-
449
- sql += " ,''";
450
-
451
- sql += " ,'1'";
452
-
453
- sql += " ,'" + title + "'";
454
-
455
- sql += " ,'" + honbun + "'";
456
-
457
- sql += " ,'" + category + "'";
458
-
459
- sql += " ,'" + author + "'";
460
-
461
- sql += " ,'" + now + "'";
462
-
463
- sql += " ,'" + now + "'";
464
-
465
- sql += " )";
466
-
467
-
468
-
469
- db.insert(sql)
470
-
471
- .then(function (result) {
472
-
473
- if (result === true) {
474
-
475
- sharedScope.setScope('kijiEditCtrl', {
476
-
477
- key: xml,
478
-
479
- xmlPath: path(kijiDir.nativeURL, xml),
480
-
481
- imagePath: '',
482
-
483
- thumbPath: '',
484
-
485
- title: title,
486
-
487
- honbun: honbun,
488
-
489
- category: category,
490
-
491
- author: author,
492
-
493
- sendFlg: null,
494
-
495
- updateDate: now
496
-
497
- });
498
-
499
- sharedScope.getScope('reloadKiji').reload();
500
-
501
- }
502
-
503
- })
504
-
505
- .catch(function (err) {
506
-
507
- window.alert(err);
508
-
509
- console.log(err);
510
-
511
- });
512
-
513
- }
514
-
515
- };
516
-
517
-
518
-
519
- //■ 上書保存
520
-
521
- $scope.overWriteFile = function () {
522
-
523
- const data = sharedScope.getScope('kijiEditCtrl')
524
-
525
- const xml = (isDefined(data.key)) ? data.key : undefined;
526
-
527
- saveProcess(xml);
528
-
529
- };
530
-
531
-
532
-
533
- //■ 別名保存
534
-
535
- $scope.createFile = function () {
536
-
537
- saveProcess();
538
-
539
- };
540
-
541
- })
542
-
543
363
  ```
544
364
 
545
365
 
546
366
 
547
367
  ```html
548
368
 
369
+ <head>
370
+
371
+ <meta charset="utf-8">
372
+
373
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
374
+
375
+ <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'">
376
+
377
+ <script src="components/loader.js"></script>
378
+
379
+ <script src="lib/angular/angular.min.js"></script>
380
+
381
+ <script src="lib/onsenui/js/onsenui.min.js"></script>
382
+
383
+ <script src="lib/onsenui/js/angular-onsenui.min.js"></script>
384
+
385
+ <script src="ext/imageResizer/resize.js"></script>
386
+
387
+ <script type="text/javascript" src="func.js"></script>
388
+
389
+ <script type="text/javascript" src="promise.js"></script>
390
+
391
+ <script type="text/javascript" src="webSql.js"></script>
392
+
393
+ <script type="text/javascript" src="index.js"></script>
394
+
395
+
396
+
397
+ <link rel="stylesheet" href="components/loader.css">
398
+
399
+ <link rel="stylesheet" href="lib/onsenui/css/onsenui.css">
400
+
401
+ <link rel="stylesheet" href="lib/onsenui/css/onsen-css-components.css">
402
+
403
+ <link rel="stylesheet" href="css/bootstrap-4.0.0-beta-dist/css/bootstrap.min.css">
404
+
405
+ <link rel="stylesheet" href="css/selectBox.css">
406
+
407
+ <link rel="stylesheet" href="css/style.css">
408
+
409
+ </head>
410
+
411
+
412
+
413
+ <body>
414
+
415
+ <ons-navigator id="appNavi" page="common.html"></ons-navigator>
416
+
417
+
418
+
419
+ <ons-template id="tabNavi1.html">
420
+
421
+ <ons-navigator id="tabNavi1" page="kijiCatalog.html"></ons-navigator>
422
+
423
+ </ons-template>
424
+
425
+
426
+
427
+ <ons-template id="tabNavi2.html">
428
+
429
+ <ons-navigator id="tabNavi2" page="gazoCatalog.html"></ons-navigator>
430
+
431
+ </ons-template>
432
+
433
+
434
+
435
+ <ons-template id="tabNavi3.html">
436
+
437
+ <ons-navigator id="tabNavi3" page="templateEdit.html"></ons-navigator>
438
+
439
+ </ons-template>
440
+
441
+ </body>
442
+
443
+
444
+
445
+ </html>
446
+
447
+
448
+
549
449
  <ons-template id="kijiCatalog.html">
550
450
 
551
- <ons-page id="kijiCatalog" ng-controller="kijiCatalogCtrl">
451
+ <ons-page id="kijiCatalog" ng-controller="kijiCatalogCtrl">
552
-
452
+
553
- <ons-list>
453
+ <ons-list>
554
-
454
+
555
- <ons-list-item class="item" modifier="chevron" ons-lazy-repeat="delegate" ng-click="openEditor($index)" tappable>
455
+ <ons-list-item class="item" modifier="chevron" ons-lazy-repeat="delegate" ng-click="openEditor($index)" tappable>
556
-
456
+
557
- <ons-row>
457
+ <ons-row>
558
-
458
+
559
- <ons-col>
459
+ <ons-col>
560
-
460
+
561
- <header>
461
+ <header>
562
-
462
+
563
- <span class="title" ng-model="title">{{item.title}}</span>
463
+ <span class="title" ng-model="title">{{item.title}}</span>
564
-
464
+
565
- <span class="label">{{item.updateDate}}</span>
465
+ <span class="label">{{item.updateDate}}</span>
566
-
466
+
567
- </header>
467
+ </header>
568
-
468
+
569
- <p style="height: 10px"></p>
469
+ <p style="height: 10px"></p>
570
-
470
+
571
- <span align="right">
471
+ <span align="right">
572
-
472
+
573
- <ons-icon icon="check-circle" size="1rem" style="color: #00fa9a;"></ons-icon>
473
+ <ons-icon icon="check-circle" size="1rem" style="color: #00fa9a;"></ons-icon>
574
-
474
+
575
- <ons-icon icon="exclamation-circle" size="1rem" style="color: #ff0000;">
475
+ <ons-icon icon="exclamation-circle" size="1rem" style="color: #ff0000;">
576
-
476
+
577
- </ons-icon>
477
+ </ons-icon>
578
-
478
+
579
- <input type="checkbox" class="checkBox" name="checkBoxKiji" ng-click="stopBubbling($event);">
479
+ <input type="checkbox" class="checkBox" name="checkBoxKiji" ng-click="stopBubbling($event);">
580
-
480
+
581
- </span>
481
+ </span>
582
-
482
+
583
- </ons-col>
483
+ </ons-col>
584
-
484
+
585
- </ons-row>
485
+ </ons-row>
586
-
486
+
587
- </ons-list-item>
487
+ </ons-list-item>
588
-
488
+
589
- </ons-list>
489
+ </ons-list>
590
-
490
+
591
- </ons-page>
491
+ </ons-page>
592
492
 
593
493
  </ons-template>
594
494
 
@@ -596,41 +496,93 @@
596
496
 
597
497
  <ons-template id="kijiEdit.html">
598
498
 
599
- <ons-page id="kijiEdit" ng-controller="kijiEditCtrl" ons-init="getData($event)">
600
-
601
- <ons-row style="margin-top:10px;">
602
-
603
- <ons-col width="50%" style="padding-right: 5px;">
604
-
605
- <ons-button style="width: 100%;" ng-click="overWriteFile();">
606
-
607
- <div class="btnWrapper">
608
-
609
- <p>上書保存</p>
610
-
611
- </div>
612
-
613
- </ons-button>
614
-
615
- </ons-col>
616
-
617
- <ons-col width="50%" style="padding-left: 5px;">
618
-
619
- <ons-button style="width: 100%;" ng-click="createFile();">
620
-
621
- <div class="btnWrapper">
622
-
623
- <p>別名保存</p>
624
-
625
- </div>
626
-
627
- </ons-button>
628
-
629
- </ons-col>
630
-
631
- </ons-row>
632
-
633
- </ons-page>
499
+ <ons-page id="kijiEdit" ng-controller="kijiEditCtrl" ons-init="getData($event)">
500
+
501
+ <ons-row class="bgWrapper">
502
+
503
+ <ons-row class="caption">
504
+
505
+ <ons-row>タイトル</ons-row>
506
+
507
+ <ons-row class="field">
508
+
509
+ <input type="text" id="title" class="inputCol" ng-model="title">
510
+
511
+ </ons-row>
512
+
513
+ <ons-row>本文</ons-row>
514
+
515
+ <ons-row class="field">
516
+
517
+ <textarea id="textarea" class="inputArea" rows="7" ng-model="honbun"></textarea>
518
+
519
+ </ons-row>
520
+
521
+ <ons-row class="field">
522
+
523
+ <ons-col width="50%" style="padding-right: 5px;">
524
+
525
+ <ons-row>種別</ons-row>
526
+
527
+ <ons-row>
528
+
529
+ <input type="text" class="inputCol" ng-model="category">
530
+
531
+ </ons-row>
532
+
533
+ </ons-col>
534
+
535
+ <ons-col width="50%" style="padding-left: 5px;">
536
+
537
+ <ons-row>作成者</ons-row>
538
+
539
+ <ons-row>
540
+
541
+ <input type="text" class="inputCol" ng-model="author">
542
+
543
+ </ons-row>
544
+
545
+ </ons-col>
546
+
547
+ </ons-row>
548
+
549
+ </ons-row>
550
+
551
+ <ons-row style="margin-top:10px;">
552
+
553
+ <ons-col width="50%" style="padding-right: 5px;">
554
+
555
+ <ons-button style="width: 100%;" ng-click="overWriteFile();">
556
+
557
+ <div class="btnWrapper">
558
+
559
+ <p>上書保存</p>
560
+
561
+ </div>
562
+
563
+ </ons-button>
564
+
565
+ </ons-col>
566
+
567
+ <ons-col width="50%" style="padding-left: 5px;">
568
+
569
+ <ons-button style="width: 100%;" ng-click="createFile();">
570
+
571
+ <div class="btnWrapper">
572
+
573
+ <p>別名保存</p>
574
+
575
+ </div>
576
+
577
+ </ons-button>
578
+
579
+ </ons-col>
580
+
581
+ </ons-row>
582
+
583
+ </ons-row>
584
+
585
+ </ons-page>
634
586
 
635
587
  </ons-template>
636
588
 

2

コメント追記

2017/12/21 08:04

投稿

shori0128
shori0128

スコア29

test CHANGED
File without changes
test CHANGED
@@ -1,5 +1,11 @@
1
1
  ###前提・実現したいこと
2
2
 
3
+ ※文字数の関係でhtml部分が非常に見づらく極一部の抜粋になっています。
4
+
5
+ 申し訳ありません。
6
+
7
+
8
+
3
9
  monacaでonsenui+angularjs1でandroidアプリの開発をしております。
4
10
 
5
11
  以下に記述するソースで$scope.$apply()でリストが更新されません。

1

html追記

2017/12/21 07:47

投稿

shori0128
shori0128

スコア29

test CHANGED
File without changes
test CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
 
28
28
 
29
- ###該当のソースコード(一部抜粋)
29
+ ###該当のソースコード(抜粋)
30
30
 
31
31
  ```javascript
32
32
 
@@ -535,3 +535,97 @@
535
535
  })
536
536
 
537
537
  ```
538
+
539
+
540
+
541
+ ```html
542
+
543
+ <ons-template id="kijiCatalog.html">
544
+
545
+ <ons-page id="kijiCatalog" ng-controller="kijiCatalogCtrl">
546
+
547
+ <ons-list>
548
+
549
+ <ons-list-item class="item" modifier="chevron" ons-lazy-repeat="delegate" ng-click="openEditor($index)" tappable>
550
+
551
+ <ons-row>
552
+
553
+ <ons-col>
554
+
555
+ <header>
556
+
557
+ <span class="title" ng-model="title">{{item.title}}</span>
558
+
559
+ <span class="label">{{item.updateDate}}</span>
560
+
561
+ </header>
562
+
563
+ <p style="height: 10px"></p>
564
+
565
+ <span align="right">
566
+
567
+ <ons-icon icon="check-circle" size="1rem" style="color: #00fa9a;"></ons-icon>
568
+
569
+ <ons-icon icon="exclamation-circle" size="1rem" style="color: #ff0000;">
570
+
571
+ </ons-icon>
572
+
573
+ <input type="checkbox" class="checkBox" name="checkBoxKiji" ng-click="stopBubbling($event);">
574
+
575
+ </span>
576
+
577
+ </ons-col>
578
+
579
+ </ons-row>
580
+
581
+ </ons-list-item>
582
+
583
+ </ons-list>
584
+
585
+ </ons-page>
586
+
587
+ </ons-template>
588
+
589
+
590
+
591
+ <ons-template id="kijiEdit.html">
592
+
593
+ <ons-page id="kijiEdit" ng-controller="kijiEditCtrl" ons-init="getData($event)">
594
+
595
+ <ons-row style="margin-top:10px;">
596
+
597
+ <ons-col width="50%" style="padding-right: 5px;">
598
+
599
+ <ons-button style="width: 100%;" ng-click="overWriteFile();">
600
+
601
+ <div class="btnWrapper">
602
+
603
+ <p>上書保存</p>
604
+
605
+ </div>
606
+
607
+ </ons-button>
608
+
609
+ </ons-col>
610
+
611
+ <ons-col width="50%" style="padding-left: 5px;">
612
+
613
+ <ons-button style="width: 100%;" ng-click="createFile();">
614
+
615
+ <div class="btnWrapper">
616
+
617
+ <p>別名保存</p>
618
+
619
+ </div>
620
+
621
+ </ons-button>
622
+
623
+ </ons-col>
624
+
625
+ </ons-row>
626
+
627
+ </ons-page>
628
+
629
+ </ons-template>
630
+
631
+ ```