1

I'm using jquery notification plugin, I tried to call the function of this plugin in angular controller shown in the below code, but always gives an exception that the method I'm calling isn't defined. I think the problem comes from the way I call this function; So does anyone know a right way for calling it ?!

 $scope.AddLayout = function () {
        LayoutApi.AddLayout(angular.toJson($scope.Layout)).success(function () {   
            $.sticky("Layout Saved Successfully", {
                stickyClass: 'success'
            });
        });
    }

1 Answer 1

0

Replace the char '$' by 'jQuery':

jQuery.sticky("Layout Saved Successfully", {
  stickyClass: 'success'
});
Sign up to request clarification or add additional context in comments.

4 Comments

@HanaYehia Are you sure that the jQuery lib is loaded? What happens if you open the browser console and type jQuery on it?
yes it's loaded. The plugin in a separate file and it's loaded too.
Maybe your code is been executed before the DOM is ready. Try wrapping it inside this: jQuery(function(){...});
I solved it this way angular.element().sticky("Layout Saved Successfully", { stickyClass: 'success' });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.