質問編集履歴
4
記述ミス
    
        title	
    CHANGED
    
    | 
         
            File without changes
         
     | 
    
        body	
    CHANGED
    
    | 
         @@ -31,21 +31,20 @@ 
     | 
|
| 
       31 
31 
     | 
    
         | 
| 
       32 
32 
     | 
    
         
             
            function getList() {
         
     | 
| 
       33 
33 
     | 
    
         
             
            	var lazyRepeat = document.getElementById('list');
         
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
      
 34 
     | 
    
         
            +
            	lazyRepeat.delegate = {
         
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
      
 35 
     | 
    
         
            +
            		createItemContent: function(i, template) {
         
     | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
      
 36 
     | 
    
         
            +
            			var dom = template.cloneNode(true);
         
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
      
 37 
     | 
    
         
            +
            			return dom;
         
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
      
 38 
     | 
    
         
            +
            		},
         
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
      
 39 
     | 
    
         
            +
            		
         
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
      
 40 
     | 
    
         
            +
            		countItems: function() {
         
     | 
| 
       41 
     | 
    
         
            -
             
     | 
| 
      
 41 
     | 
    
         
            +
            			return 15;
         
     | 
| 
       42 
     | 
    
         
            -
             
     | 
| 
      
 42 
     | 
    
         
            +
            		},
         
     | 
| 
       43 
     | 
    
         
            -
             
     | 
| 
      
 43 
     | 
    
         
            +
            		destroyItem: function(index, item) {
         
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
      
 44 
     | 
    
         
            +
            			console.log('Destroyed item with index: ' + index);
         
     | 
| 
       45 
     | 
    
         
            -
             
     | 
| 
      
 45 
     | 
    
         
            +
            		}
         
     | 
| 
       46 
     | 
    
         
            -
             
     | 
| 
      
 46 
     | 
    
         
            +
            	};
         
     | 
| 
       47 
     | 
    
         
            -
             
     | 
| 
      
 47 
     | 
    
         
            +
            	lazyRepeat.refresh();
         
     | 
| 
       48 
     | 
    
         
            -
            	}
         
     | 
| 
       49 
48 
     | 
    
         
             
            }
         
     | 
| 
       50 
49 
     | 
    
         | 
| 
       51 
50 
     | 
    
         | 
3
追加
    
        title	
    CHANGED
    
    | 
         
            File without changes
         
     | 
    
        body	
    CHANGED
    
    | 
         @@ -21,7 +21,32 @@ 
     | 
|
| 
       21 
21 
     | 
    
         
             
            ```
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
23 
     | 
    
         
             
            ```javascript
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            module.controller("HogeCtrl", function() {
         
     | 
| 
      
 26 
     | 
    
         
            +
                document.addEventListener('init', getList, false);
         
     | 
| 
       24 
     | 
    
         
            -
            this.popP = function() {
         
     | 
| 
      
 27 
     | 
    
         
            +
               this.popP = function() {
         
     | 
| 
       25 
     | 
    
         
            -
            alert('hoge')
         
     | 
| 
      
 28 
     | 
    
         
            +
                  alert('hoge')
         
     | 
| 
       26 
     | 
    
         
            -
            };
         
     | 
| 
      
 29 
     | 
    
         
            +
              };
         
     | 
| 
      
 30 
     | 
    
         
            +
            });	
         
     | 
| 
      
 31 
     | 
    
         
            +
            	
         
     | 
| 
      
 32 
     | 
    
         
            +
            function getList() {
         
     | 
| 
      
 33 
     | 
    
         
            +
            	var lazyRepeat = document.getElementById('list');
         
     | 
| 
      
 34 
     | 
    
         
            +
            		lazyRepeat.delegate = {
         
     | 
| 
      
 35 
     | 
    
         
            +
            			createItemContent: function(i, template) {
         
     | 
| 
      
 36 
     | 
    
         
            +
            				var dom = template.cloneNode(true);
         
     | 
| 
      
 37 
     | 
    
         
            +
            				return dom;
         
     | 
| 
      
 38 
     | 
    
         
            +
            			},
         
     | 
| 
      
 39 
     | 
    
         
            +
            			
         
     | 
| 
      
 40 
     | 
    
         
            +
            			countItems: function() {
         
     | 
| 
      
 41 
     | 
    
         
            +
            				return 15;
         
     | 
| 
      
 42 
     | 
    
         
            +
            			},
         
     | 
| 
      
 43 
     | 
    
         
            +
            			destroyItem: function(index, item) {
         
     | 
| 
      
 44 
     | 
    
         
            +
            				console.log('Destroyed item with index: ' + index);
         
     | 
| 
      
 45 
     | 
    
         
            +
            			}
         
     | 
| 
      
 46 
     | 
    
         
            +
            		};
         
     | 
| 
      
 47 
     | 
    
         
            +
            		lazyRepeat.refresh();
         
     | 
| 
      
 48 
     | 
    
         
            +
            	}
         
     | 
| 
      
 49 
     | 
    
         
            +
            }
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
       27 
52 
     | 
    
         
             
            ```
         
     | 
2
追加
    
        title	
    CHANGED
    
    | 
         
            File without changes
         
     | 
    
        body	
    CHANGED
    
    | 
         @@ -9,9 +9,19 @@ 
     | 
|
| 
       9 
9 
     | 
    
         
             
            さすがにこれでは使い道がないので仕様ではないと思っていますが、この問題を解決する方法はありませんでしょうか。。
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
            ```html
         
     | 
| 
      
 12 
     | 
    
         
            +
            <ons-template id="hoge.html">
         
     | 
| 
      
 13 
     | 
    
         
            +
            <ons-page ng-controller="HogeCtrl as hoge">
         
     | 
| 
       12 
14 
     | 
    
         
             
            <ons-lazy-repeat id="list">
         
     | 
| 
       13 
15 
     | 
    
         
             
                <ons-list-item>
         
     | 
| 
       14 
     | 
    
         
            -
                    <div ng-click="">hoge</div>
         
     | 
| 
      
 16 
     | 
    
         
            +
                    <div ng-click="hoge.popP()">hoge</div>
         
     | 
| 
       15 
17 
     | 
    
         
             
                </ons-list-item>
         
     | 
| 
       16 
18 
     | 
    
         
             
            </ons-lazy-repeat>
         
     | 
| 
      
 19 
     | 
    
         
            +
            </ons-page>
         
     | 
| 
      
 20 
     | 
    
         
            +
            </ons-template>
         
     | 
| 
      
 21 
     | 
    
         
            +
            ```
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            ```javascript
         
     | 
| 
      
 24 
     | 
    
         
            +
            this.popP = function() {
         
     | 
| 
      
 25 
     | 
    
         
            +
            alert('hoge')
         
     | 
| 
      
 26 
     | 
    
         
            +
            };
         
     | 
| 
       17 
27 
     | 
    
         
             
            ```
         
     | 
1
記載内容の追加
    
        title	
    CHANGED
    
    | 
         
            File without changes
         
     | 
    
        body	
    CHANGED
    
    | 
         @@ -3,6 +3,7 @@ 
     | 
|
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            質問は掲題の通りでons-lazy-repeatを使用するとng-clickが使用できません。
         
     | 
| 
       5 
5 
     | 
    
         
             
            当初domを操作していることが問題なのかと考えましたが、直接ng-clickを書き込んでもNGでした。
         
     | 
| 
      
 6 
     | 
    
         
            +
            ※使用できない=タップしても何も起きません。エラーもでません。
         
     | 
| 
       6 
7 
     | 
    
         | 
| 
       7 
8 
     | 
    
         
             
            そこで単純にons-lazy-repeatタグを除去したところ正常に動作しました。
         
     | 
| 
       8 
9 
     | 
    
         
             
            さすがにこれでは使い道がないので仕様ではないと思っていますが、この問題を解決する方法はありませんでしょうか。。
         
     |