├── .gitignore ├── Gruntfile.js ├── README.md ├── demo ├── app.js ├── app_multi.js ├── demo.css ├── demo.htm ├── demo_form.htm └── demo_multiple_iscrolls.htm ├── package.json └── src ├── ng-iscroll.js └── ng-iscroll.min.js /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store 3 | node_modules 4 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | /*global module:false*/ 2 | module.exports = function(grunt) { 3 | 4 | // Project configuration. 5 | grunt.initConfig({ 6 | pkg: '', 7 | meta: { 8 | banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %>\n' + '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' + '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' + ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */' 9 | }, 10 | 11 | jshint: { 12 | files: ['Gruntfile.js', 'src/ng-iscroll.js'] 13 | }, 14 | 15 | uglify: { 16 | options: { 17 | mangle: false, 18 | preserveComments: 'some' 19 | }, 20 | target: { 21 | files: { 22 | 'src/ng-iscroll.min.js': ['src/ng-iscroll.js'] 23 | } 24 | } 25 | } 26 | 27 | }); 28 | 29 | // load Plugins 30 | grunt.loadNpmTasks('grunt-contrib-jshint'); 31 | grunt.loadNpmTasks('grunt-contrib-uglify'); 32 | 33 | // Register tasks. 34 | grunt.registerTask('default', ['jshint','uglify']); 35 | }; 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ng-iScroller v1.3 2 | ============ 3 | 4 | AngularJS Module that enables iScroll 5.x to work using a directive 5 | 6 | Demos 7 | ------------ 8 | 9 | See demo/ Directory 10 | Note: Recommended to be used with iOS or Android devices only 11 | 12 | 13 | Dependencies 14 | ------------ 15 | - [AngularJS 1.2+](http://angularjs.org/) (Tested with AngularJs 1.3 & 1.4) 16 | - [iScroll 5.1.x](https://github.com/cubiq/iscroll) 17 | 18 | Installation 19 | ------------ 20 | - **Bower**: 21 | Install the package by adding `ng-iScroll` to your `bower.json` file. 22 | 23 | Reporting Issues 24 | ------------- 25 | - Issues can be reported at the Github project. 26 | 27 | Features 28 | ------------- 29 | 30 | * Option to set time delay on binding of iScroll to dom 31 | * Support for multiple iScrolls per page 32 | * See demo/demo_multiple_iscrolls.htm for how to use multiple iScroll divs on the same page 33 | * Support for setting iScroll specific options via App Controller 34 | * See demo/app.js or demo/app_multi.js for how 35 | * Support for iScroll 'refresh' and other functions via App Controller 36 | * iScroll Options can be set via App Controller 37 | 38 | 39 | Usage 40 | --------- 41 | 42 | * Include ng-iscroll.js or ng-iscroll.min.js in your html header or existing file before your application main js file 43 | * Add 'ng-iscroll' to your Angular app's dependencies 44 | * Example ```var App = angular.module('App', ['ng-iscroll']);``` 45 | 46 | * Add directive `ng-iscroll` to the ```
``` 47 | * Example: ```
``` 48 | 49 | 50 | Options 51 | ------------- 52 | #### HTML Directive Settings 53 | 54 | **Binding Delay**: 55 | If you want to delay the iScroll binding due to having animations or using another JS Library to modify the Angular view you can add a timeout value by using the attribute ```ng-iscroll-delay='{delayInMiliseconds}'```. The default delay is 5ms. 56 | 57 | **Forms**: 58 | Forms within an iScroll has certain issues with editing Text values or Select boxes. To enable support for forms add the following option to the wrapper div: ```ng-iscroll-form='true'``` the default is set to 'false' 59 | 60 | **Naming of Instance**: 61 | When multiple iScrolls are present on a single page and each needs different runtime settings or functions there is a need to identify each instance. This is done either by setting the 'ng-iscroll="{instanceName}"' or if not set it will default to the id of the div. 62 | 63 | *Note:* This breaks version 1.0's usage of the ng-iscroll value to define the delay in dom binding. Please update your code to use ng-iscroll-delay to change the default delay. 64 | 65 | See demos/ directory for examples of both 66 | 67 | 68 | #### Angular Controller Settings 69 | 70 | iScroll exposes both runtime and other functions that can change the appearance or behavior of the iScroll. These can be set via the AppController to further configure iScroll. 71 | 72 | Example: 73 | 74 | HTML: 75 | ``` 76 |
77 | 78 |
79 | ``` 80 | 81 | AppController: 82 | ``` 83 | $scope.$parent.myScrollOptions = { 84 | 'wrapper': { 85 | snap: false, 86 | onScrollEnd: function () 87 | { 88 | alert('finshed scrolling wrapper'); 89 | }}, 90 | }; 91 | 92 | $scope.refreshiScroll = function () 93 | { 94 | $scope.$parent.myScroll['wrapper'].refresh(); 95 | alert('wrapper refreshed'); 96 | }; 97 | ``` 98 | 99 | The default settings for ng-iScroll are the following: 100 | - snap: true 101 | - momentum: true 102 | - hScrollbar: false 103 | - mouseWheel: true 104 | 105 | The above can be overridden using the $scope.$parent.myScrollOptions option in your Controller. 106 | 107 | For more examples see the demo directory. 108 | 109 | 110 | License 111 | -------------- 112 | 113 | ng-IScroll is released under the [MIT License](http://opensource.org/licenses/MIT). 114 | 115 | 116 | Special Thanks 117 | --------------- 118 | 119 | Thanks to the following help for submitting bugs and suggesting new features: 120 | 121 | [Rodrigo Mesquita de Abreu](https://github.com/rodmabreu) 122 | 123 | [Robert](https://github.com/rtpm) 124 | 125 | [Andre Meyering](https://github.com/archer96) 126 | 127 | [Brandon Benson](https://github.com/bensane) 128 | -------------------------------------------------------------------------------- /demo/app.js: -------------------------------------------------------------------------------- 1 | var App = angular.module('App', ['ng-iscroll']); 2 | 3 | App.controller('Controller', function ($scope) 4 | { 5 | // Defines additional options such as onScrollEnd and other runtime settings 6 | // exposed by iScroll can be defined per id attribute 7 | $scope.$parent.myScrollOptions = { 8 | snap: false, 9 | onScrollEnd: function () 10 | { 11 | alert('finshed scrolling'); 12 | } 13 | }; 14 | 15 | // expose refreshiScroll() function for ng-onclick or other meth 16 | $scope.refreshiScroll = function () 17 | { 18 | $scope.$parent.myScroll['wrapper'].refresh(); 19 | }; 20 | 21 | 22 | }); 23 | -------------------------------------------------------------------------------- /demo/app_multi.js: -------------------------------------------------------------------------------- 1 | var App = angular.module('App', ['ng-iscroll']); 2 | 3 | App.controller('Controller', function ($scope) 4 | { 5 | $scope.$parent.myScrollOptions = { 6 | 'testWrap2': { 7 | snap: false, 8 | onScrollEnd: function () 9 | { 10 | alert('finshed scrolling wrapper2'); 11 | }}, 12 | 'wrapper3': { 13 | snap: false, 14 | onScrollEnd: function () 15 | { 16 | alert('finshed scrolling wrapper3'); 17 | }} 18 | }; 19 | 20 | 21 | $scope.refreshiScroll3 = function () 22 | { 23 | $scope.$parent.myScroll['wrapper3'].refresh(); 24 | alert('wrapper3 refreshed'); 25 | }; 26 | 27 | 28 | $scope.refreshiScroll2 = function () 29 | { 30 | $scope.$parent.myScroll['testWrap2'].refresh(); 31 | alert('testWrap2 refreshed'); 32 | }; 33 | }); -------------------------------------------------------------------------------- /demo/demo.css: -------------------------------------------------------------------------------- 1 | body,ul,li { 2 | padding:0; 3 | margin:0; 4 | border:0; 5 | } 6 | 7 | body { 8 | font-size:12px; 9 | -webkit-user-select:none; 10 | -webkit-text-size-adjust:none; 11 | font-family:helvetica; 12 | } 13 | 14 | #header { 15 | position:absolute; 16 | top:0; left:0; 17 | width:100%; 18 | height:45px; 19 | line-height:45px; 20 | background-image:-webkit-gradient(linear, 0 0, 0 100%, color-stop(0, #fe96c9), color-stop(0.05, #d51875), color-stop(1, #7b0a2e)); 21 | background-image:-moz-linear-gradient(top, #fe96c9, #d51875 5%, #7b0a2e); 22 | background-image:-o-linear-gradient(top, #fe96c9, #d51875 5%, #7b0a2e); 23 | padding:0; 24 | color:#eee; 25 | font-size:20px; 26 | text-align:center; 27 | } 28 | 29 | #header a { 30 | color:#f3f3f3; 31 | text-decoration:none; 32 | font-weight:bold; 33 | text-shadow:0 -1px 0 rgba(0,0,0,0.5); 34 | } 35 | 36 | #footer { 37 | position:absolute; 38 | bottom:0; left:0; 39 | width:100%; 40 | height:48px; 41 | background-image:-webkit-gradient(linear, 0 0, 0 100%, color-stop(0, #999), color-stop(0.02, #666), color-stop(1, #222)); 42 | background-image:-moz-linear-gradient(top, #999, #666 2%, #222); 43 | background-image:-o-linear-gradient(top, #999, #666 2%, #222); 44 | padding:0; 45 | border-top:1px solid #444; 46 | } 47 | 48 | #wrapper { 49 | position:absolute; z-index:1; 50 | top:45px; bottom:48px; left:0; 51 | width:100%; 52 | background:#555; 53 | overflow:auto; 54 | } 55 | 56 | #wrapper2 { 57 | position:absolute; z-index:1; 58 | top:45px; bottom:48px; left:0; 59 | width:50%; 60 | background:#555; 61 | overflow:auto; 62 | } 63 | 64 | #wrapper3 { 65 | position:absolute; z-index:1; 66 | top:45px; bottom:48px; left:51%; 67 | width:50%; 68 | background:#555; 69 | overflow:auto; 70 | } 71 | 72 | 73 | #scroller, .scroller { 74 | position:relative; 75 | -webkit-tap-highlight-color:rgba(0,0,0,0); 76 | float:left; 77 | width:100%; 78 | padding:0; 79 | } 80 | 81 | #scroller ul, .scroller ul { 82 | position:relative; 83 | list-style:none; 84 | padding:0; 85 | margin:0; 86 | width:100%; 87 | text-align:left; 88 | } 89 | 90 | #scroller li, .scroller li { 91 | padding:0 10px; 92 | height:40px; 93 | line-height:40px; 94 | border-bottom:1px solid #ccc; 95 | border-top:1px solid #fff; 96 | background-color:#fafafa; 97 | font-size:14px; 98 | } 99 | 100 | #scroller li > a, .scroller li > a { 101 | display:block; 102 | } 103 | -------------------------------------------------------------------------------- /demo/demo.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Demo 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |
17 |
18 |
    19 |
  • Pretty row 1
  • 20 | 21 |
  • Pretty row 2
  • 22 |
  • Pretty row 3
  • 23 |
  • Pretty row 4
  • 24 |
  • Pretty row 5
  • 25 |
  • Pretty row 6
  • 26 |
  • Pretty row 7
  • 27 |
  • Pretty row 8
  • 28 |
  • Pretty row 9
  • 29 |
  • Pretty row 10
  • 30 |
  • Pretty row 11
  • 31 |
  • Pretty row 12
  • 32 |
  • Pretty row 13
  • 33 |
  • Pretty row 14
  • 34 |
  • Pretty row 15
  • 35 |
  • Pretty row 16
  • 36 |
  • Pretty row 17
  • 37 |
  • Pretty row 18
  • 38 |
  • Pretty row 19
  • 39 |
  • Pretty row 20
  • 40 |
  • Pretty row 21
  • 41 |
  • Pretty row 22
  • 42 |
  • Pretty row 23
  • 43 |
  • Pretty row 24
  • 44 |
  • Pretty row 25
  • 45 |
  • Pretty row 26
  • 46 |
  • Pretty row 27
  • 47 |
  • Pretty row 28
  • 48 |
  • Pretty row 29
  • 49 |
  • Pretty row 30
  • 50 |
  • Pretty row 31
  • 51 |
  • Pretty row 32
  • 52 |
  • Pretty row 33
  • 53 |
  • Pretty row 34
  • 54 |
  • Pretty row 35
  • 55 |
  • Pretty row 36
  • 56 |
  • Pretty row 37
  • 57 |
  • Pretty row 38
  • 58 |
  • Pretty row 39
  • 59 |
  • Pretty row 40
  • 60 |
61 |
62 |
63 |
64 | 65 | 66 |
67 | 68 | -------------------------------------------------------------------------------- /demo/demo_form.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Demo 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 | 15 |
16 |
17 |
    18 |
  • 19 |
  • Pretty row 2
  • 20 |
  • 21 | True 22 | False 23 |
  • 24 |
  • Pretty row 4
  • 25 |
  • 26 | Meteors 27 | Asteriods 28 |
  • 29 |
  • Pretty row 6
  • 30 |
  • 31 |
  • Pretty row 8
  • 32 |
  • Pretty row 9
  • 33 |
  • Pretty row 10
  • 34 |
  • Pretty row 11
  • 35 |
  • Pretty row 12
  • 36 |
  • Pretty row 13
  • 37 |
  • Pretty row 14
  • 38 |
  • Pretty row 15
  • 39 |
  • Pretty row 16
  • 40 |
  • Pretty row 17
  • 41 |
  • Pretty row 18
  • 42 |
  • Pretty row 19
  • 43 |
  • Pretty row 20
  • 44 |
  • Pretty row 21
  • 45 |
  • Pretty row 22
  • 46 |
  • Pretty row 23
  • 47 |
  • Pretty row 24
  • 48 |
  • Pretty row 25
  • 49 |
  • Pretty row 26
  • 50 |
  • Pretty row 27
  • 51 |
  • Pretty row 28
  • 52 |
  • Pretty row 29
  • 53 |
  • Pretty row 30
  • 54 |
  • Pretty row 31
  • 55 |
  • Pretty row 32
  • 56 |
  • Pretty row 33
  • 57 |
  • Pretty row 34
  • 58 |
  • Pretty row 35
  • 59 |
  • Pretty row 36
  • 60 |
  • Pretty row 37
  • 61 |
  • Pretty row 38
  • 62 |
  • Pretty row 39
  • 63 |
  • Pretty row 40
  • 64 |
65 |
66 |
67 |
68 |
69 | 70 | -------------------------------------------------------------------------------- /demo/demo_multiple_iscrolls.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Demo 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 | 15 |
16 |
17 |
    18 |
  • Pretty row 1
  • 19 |
  • Pretty row 2
  • 20 |
  • Pretty row 3 21 | 22 |
  • 23 |
  • Pretty row 4
  • 24 |
  • Pretty row 5
  • 25 |
  • Pretty row 6
  • 26 |
  • Pretty row 7
  • 27 |
  • Pretty row 8
  • 28 |
  • Pretty row 9
  • 29 |
  • 30 | True 31 | False 32 |
  • 33 |
  • Pretty row 11
  • 34 |
  • Pretty row 12
  • 35 |
  • Pretty row 13
  • 36 |
  • Pretty row 14
  • 37 |
  • Pretty row 15
  • 38 |
  • Pretty row 16
  • 39 | 40 |
41 |
42 |
43 |
44 |
45 |
    46 |
  • Pretty row 1
  • 47 |
  • Pretty row 2
  • 48 |
  • Pretty row 3
  • 49 |
  • Pretty row 4 50 | 51 |
  • 52 |
  • Pretty row 5
  • 53 |
  • Pretty row 6
  • 54 |
  • Pretty row 7
  • 55 |
  • Pretty row 8
  • 56 |
  • Pretty row 9
  • 57 |
  • Pretty row 10
  • 58 |
  • Pretty row 11
  • 59 |
  • Pretty row 12
  • 60 |
  • Pretty row 13
  • 61 |
  • Pretty row 14
  • 62 |
  • Pretty row 15
  • 63 |
  • Pretty row 16
  • 64 | 65 |
66 |
67 |
68 |
69 |
70 | 71 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ng-iscroll", 3 | "version": "1.3.1", 4 | "private": false, 5 | "author": "Brad Vernon ", 6 | "keywords": [ 7 | "iscroll", 8 | "angular", 9 | "directive" 10 | ], 11 | "license": "MIT", 12 | "main" : "src/ng-iscroll.min.js", 13 | "repository": "/ibspoof/ng-iScroll", 14 | "bugs": { 15 | "url": "https://github.com//ibspoof/ng-iScroll/issues" 16 | }, 17 | "homepage": "https://github.com//ibspoof/ng-iScroll" 18 | } 19 | -------------------------------------------------------------------------------- /src/ng-iscroll.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Copyright (c) 2013 Brad Vernon 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | */ 23 | 24 | angular.module('ng-iscroll', []).directive('ngIscroll', function () 25 | { 26 | return { 27 | replace: false, 28 | restrict: 'A', 29 | link: function (scope, element, attr) 30 | { 31 | // default timeout 32 | var ngiScroll_timeout = 5; 33 | 34 | // default options 35 | var ngiScroll_opts = { 36 | snap: true, 37 | momentum: true, 38 | hScrollbar: false, 39 | mouseWheel: true, 40 | click: false, 41 | tap: true 42 | }; 43 | 44 | // scroll key /id 45 | var scroll_key = attr.ngIscroll; 46 | 47 | if (scroll_key === '') { 48 | scroll_key = attr.id; 49 | } 50 | 51 | if (scope.$parent.myScrollOptions) { 52 | for (var i in scope.$parent.myScrollOptions) { 53 | if(typeof(scope.$parent.myScrollOptions[i])!=="object"){ 54 | ngiScroll_opts[i] = scope.$parent.myScrollOptions[i]; 55 | } else if (i === scroll_key) { 56 | for (var k in scope.$parent.myScrollOptions[i]) { 57 | ngiScroll_opts[k] = scope.$parent.myScrollOptions[i][k]; 58 | } 59 | } 60 | } 61 | } 62 | 63 | // iScroll initialize function 64 | function setScroll() 65 | { 66 | if (scope.$parent.myScroll === undefined) { 67 | scope.$parent.myScroll = []; 68 | } 69 | 70 | scope.$parent.myScroll[scroll_key] = new IScroll(element[0], ngiScroll_opts); 71 | } 72 | 73 | // new specific setting for setting timeout using: ng-iscroll-timeout='{val}' 74 | if (attr.ngIscrollDelay !== undefined) { 75 | ngiScroll_timeout = attr.ngIscrollDelay; 76 | } 77 | 78 | // watch for 'ng-iscroll' directive in html code 79 | scope.$watch(attr.ngIscroll, function () 80 | { 81 | setTimeout(setScroll, ngiScroll_timeout); 82 | }); 83 | 84 | // add ng-iscroll-refresher for watching dynamic content inside iscroll 85 | if(attr.ngIscrollRefresher !== undefined) { 86 | scope.$watch(attr.ngIscrollRefresher, function () 87 | { 88 | if(scope.$parent.myScroll[scroll_key] !== undefined) scope.$parent.myScroll[scroll_key].refresh(); 89 | }); 90 | } 91 | 92 | // destroy the iscroll instance if we are moving away from a state to another 93 | // the DOM has changed and he only instance is not necessary any more 94 | scope.$on('$destroy', function () { 95 | scope.$parent.myScroll[scroll_key].destroy(); 96 | }); 97 | } 98 | }; 99 | }); 100 | -------------------------------------------------------------------------------- /src/ng-iscroll.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Copyright (c) 2013 Brad Vernon 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | */ 23 | angular.module("ng-iscroll",[]).directive("ngIscroll",function(){return{replace:!1,restrict:"A",link:function(scope,element,attr){function setScroll(){void 0===scope.$parent.myScroll&&(scope.$parent.myScroll=[]),scope.$parent.myScroll[scroll_key]=new IScroll(element[0],ngiScroll_opts)}var ngiScroll_timeout=5,ngiScroll_opts={snap:!0,momentum:!0,hScrollbar:!1,mouseWheel:!0,click:!1,tap:!0},scroll_key=attr.ngIscroll;if(""===scroll_key&&(scroll_key=attr.id),scope.$parent.myScrollOptions)for(var i in scope.$parent.myScrollOptions)if("object"!=typeof scope.$parent.myScrollOptions[i])ngiScroll_opts[i]=scope.$parent.myScrollOptions[i];else if(i===scroll_key)for(var k in scope.$parent.myScrollOptions[i])ngiScroll_opts[k]=scope.$parent.myScrollOptions[i][k];void 0!==attr.ngIscrollDelay&&(ngiScroll_timeout=attr.ngIscrollDelay),scope.$watch(attr.ngIscroll,function(){setTimeout(setScroll,ngiScroll_timeout)}),void 0!==attr.ngIscrollRefresher&&scope.$watch(attr.ngIscrollRefresher,function(){void 0!==scope.$parent.myScroll[scroll_key]&&scope.$parent.myScroll[scroll_key].refresh()}),scope.$on("$destroy",function(){scope.$parent.myScroll[scroll_key].destroy()})}}}); 24 | --------------------------------------------------------------------------------