質問編集履歴
4
記述ミス
test
CHANGED
File without changes
|
test
CHANGED
@@ -64,35 +64,33 @@
|
|
64
64
|
|
65
65
|
var lazyRepeat = document.getElementById('list');
|
66
66
|
|
67
|
-
|
67
|
+
lazyRepeat.delegate = {
|
68
68
|
|
69
|
-
|
69
|
+
createItemContent: function(i, template) {
|
70
70
|
|
71
|
-
|
71
|
+
var dom = template.cloneNode(true);
|
72
72
|
|
73
|
-
|
73
|
+
return dom;
|
74
74
|
|
75
|
-
|
75
|
+
},
|
76
76
|
|
77
|
-
|
77
|
+
|
78
78
|
|
79
|
-
|
79
|
+
countItems: function() {
|
80
80
|
|
81
|
-
|
81
|
+
return 15;
|
82
82
|
|
83
|
-
|
83
|
+
},
|
84
84
|
|
85
|
-
|
85
|
+
destroyItem: function(index, item) {
|
86
86
|
|
87
|
-
|
87
|
+
console.log('Destroyed item with index: ' + index);
|
88
88
|
|
89
|
-
|
89
|
+
}
|
90
90
|
|
91
|
-
|
91
|
+
};
|
92
92
|
|
93
|
-
|
93
|
+
lazyRepeat.refresh();
|
94
|
-
|
95
|
-
}
|
96
94
|
|
97
95
|
}
|
98
96
|
|
3
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -44,10 +44,60 @@
|
|
44
44
|
|
45
45
|
```javascript
|
46
46
|
|
47
|
-
this.popP = function() {
|
48
47
|
|
49
|
-
alert('hoge')
|
50
48
|
|
49
|
+
module.controller("HogeCtrl", function() {
|
50
|
+
|
51
|
+
document.addEventListener('init', getList, false);
|
52
|
+
|
53
|
+
this.popP = function() {
|
54
|
+
|
55
|
+
alert('hoge')
|
56
|
+
|
51
|
-
};
|
57
|
+
};
|
58
|
+
|
59
|
+
});
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
function getList() {
|
64
|
+
|
65
|
+
var lazyRepeat = document.getElementById('list');
|
66
|
+
|
67
|
+
lazyRepeat.delegate = {
|
68
|
+
|
69
|
+
createItemContent: function(i, template) {
|
70
|
+
|
71
|
+
var dom = template.cloneNode(true);
|
72
|
+
|
73
|
+
return dom;
|
74
|
+
|
75
|
+
},
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
countItems: function() {
|
80
|
+
|
81
|
+
return 15;
|
82
|
+
|
83
|
+
},
|
84
|
+
|
85
|
+
destroyItem: function(index, item) {
|
86
|
+
|
87
|
+
console.log('Destroyed item with index: ' + index);
|
88
|
+
|
89
|
+
}
|
90
|
+
|
91
|
+
};
|
92
|
+
|
93
|
+
lazyRepeat.refresh();
|
94
|
+
|
95
|
+
}
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
52
102
|
|
53
103
|
```
|
2
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,14 +20,34 @@
|
|
20
20
|
|
21
21
|
```html
|
22
22
|
|
23
|
+
<ons-template id="hoge.html">
|
24
|
+
|
25
|
+
<ons-page ng-controller="HogeCtrl as hoge">
|
26
|
+
|
23
27
|
<ons-lazy-repeat id="list">
|
24
28
|
|
25
29
|
<ons-list-item>
|
26
30
|
|
27
|
-
<div ng-click="">hoge</div>
|
31
|
+
<div ng-click="hoge.popP()">hoge</div>
|
28
32
|
|
29
33
|
</ons-list-item>
|
30
34
|
|
31
35
|
</ons-lazy-repeat>
|
32
36
|
|
37
|
+
</ons-page>
|
38
|
+
|
39
|
+
</ons-template>
|
40
|
+
|
33
41
|
```
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
```javascript
|
46
|
+
|
47
|
+
this.popP = function() {
|
48
|
+
|
49
|
+
alert('hoge')
|
50
|
+
|
51
|
+
};
|
52
|
+
|
53
|
+
```
|
1
記載内容の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -7,6 +7,8 @@
|
|
7
7
|
質問は掲題の通りでons-lazy-repeatを使用するとng-clickが使用できません。
|
8
8
|
|
9
9
|
当初domを操作していることが問題なのかと考えましたが、直接ng-clickを書き込んでもNGでした。
|
10
|
+
|
11
|
+
※使用できない=タップしても何も起きません。エラーもでません。
|
10
12
|
|
11
13
|
|
12
14
|
|