Does not work
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' }}
You can use this directive: <div class="scroll-body" slimscroll="{height: 150}">
Sorry, I did not copy the syntax I used correctly. I used your syntax:
{{ somestuffhere || 'nuttin here' }}
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).
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