angular-slimscroll icon indicating copy to clipboard operation
angular-slimscroll copied to clipboard

Does not work

Open gmarshall56 opened this issue 10 years ago • 4 comments

I'm getting this error: TypeError: undefined is not a function at refresh (http://localhost:9000/assets/javascripts/app/directives.js:249:30) at init (http://localhost:9000/assets/javascripts/app/directives.js:254:21) at link (http://localhost:9000/assets/javascripts/app/directives.js:278:17) at nodeLinkFn (http://localhost:9000/assets/javascripts/lib/angular/angular-1.2.27.js:6736:13) at compositeLinkFn (http://localhost:9000/assets/javascripts/lib/angular/angular-1.2.27.js:6130:13) at compositeLinkFn (http://localhost:9000/assets/javascripts/lib/angular/angular-1.2.27.js:6133:13) at compositeLinkFn (http://localhost:9000/assets/javascripts/lib/angular/angular-1.2.27.js:6133:13) at compositeLinkFn (http://localhost:9000/assets/javascripts/lib/angular/angular-1.2.27.js:6133:13) at nodeLinkFn (http://localhost:9000/assets/javascripts/lib/angular/angular-1.2.27.js:6730:24) at compositeLinkFn (http://localhost:9000/assets/javascripts/lib/angular/angular-1.2.27.js:6130:13)

and lines 249 thru 278 of your directive are these lines:

line 249=> $($elem).slimScroll({ destroy: true }); $($elem).slimScroll(option); }; var init = function () { line 254=> refresh(); if ($attr.slimscroll && !option.noWatch) { off.push($scope.$watchCollection($attr.slimscroll, refresh)); } if ($attr.slimscrollWatch) { off.push($scope.$watchCollection($attr.slimscrollWatch, refresh)); } if ($attr.slimscrolllistento) { off.push($scope.$on($attr.slimscrolllistento, refresh)); } }; var destructor = function () { $($elem).slimScroll({ destroy: true }); off.forEach(function (unbind) { unbind(); }); off = null; }; off.push($scope.$on('$destroy', destructor)); line 278= > init();

Is this the correct HTML syntax to call the directive:

{{ someTextHere || 'nuttin here' }}

If not can you please provide a sample syntax of calling the directive? Thank you Gary

gmarshall56 avatar Apr 09 '15 23:04 gmarshall56

You can use this directive: <div class="scroll-body" slimscroll="{height: 150}">

ziscloud avatar Apr 10 '15 10:04 ziscloud

Sorry, I did not copy the syntax I used correctly. I used your syntax:

{{ somestuffhere || 'nuttin here' }}

and I'm still getting the error thrown: TypeError: undefined is not a function at refresh (http://localhost:9000/assets/javascripts/app/directives.js:249:30) at init (http://localhost:9000/assets/javascripts/app/directives.js:254:21) at link (http://localhost:9000/assets/javascripts/app/directives.js:278:17) at nodeLinkFn (http://localhost:9000/assets/javascripts/lib/angular/angular-1.2.27.js:6736:13) at compositeLinkFn (http://localhost:9000/assets/javascripts/lib/angular/angular-1.2.27.js:6130:13) at compositeLinkFn (http://localhost:9000/assets/javascripts/lib/angular/angular-1.2.27.js:6133:13) at compositeLinkFn (http://localhost:9000/assets/javascripts/lib/angular/angular-1.2.27.js:6133:13) at compositeLinkFn (http://localhost:9000/assets/javascripts/lib/angular/angular-1.2.27.js:6133:13) at nodeLinkFn (http://localhost:9000/assets/javascripts/lib/angular/angular-1.2.27.js:6730:24) at compositeLinkFn (http://localhost:9000/assets/javascripts/lib/angular/angular-1.2.27.js:6130:13)

gmarshall56 avatar Apr 10 '15 13:04 gmarshall56

Got it working. Two things: First: stupid mistake on my part. Needed to download and include the jquery.slimscroll.min.js file from github.com/rochal/jQuery-slimScroll. Second: The correct syntax to use is: div class="scroll-body" slimscroll="{height: '250px'}" (single quotes required around the value).

gmarshall56 avatar Apr 10 '15 20:04 gmarshall56

i want to give my custom style for slim scroll i have used div class="scroll-body" slimscroll="{height: '250px'}" but it is not working it is using its default height

fresjitendra avatar Aug 20 '16 05:08 fresjitendra