Here is my code I want to recall $('.ams-items').slimScroll()
function
angular.element(document).ready(function () {
$('.ams-items').slimScroll({
alwaysVisible: true
});
});
Please help me!
Here is my code I want to recall $('.ams-items').slimScroll()
function
angular.element(document).ready(function () {
$('.ams-items').slimScroll({
alwaysVisible: true
});
});
Please help me!
Any jQuery code that manipulates the DOM should be encapsulated in a custom directive so that it is executed when the AngularJS framework instantiates the element.
app.directive("mySlimScroll", function()
return {
link: postLink,
};
function postLink(scope,elem,attrs) {
elem.slimScroll({
alwaysVisible: true
});
}
});
<div class="ams-items" my-slim-scroll>
</div>
To use jQuery, simply ensure it is loaded before the angular.js
file.
For more information, see