0

I am using below code inside document ready function

 toastr.clear();
 toastr.options.closeButton = true;
 toastr.info('Message with a close button', '');

and its working fine. i have confusion to call mentioned function in controller.

2

2 Answers 2

3

I would recommend using an Angular toastr instead: https://github.com/Foxandxss/angular-toastr

Then you are away from the pain of integrating jQuery with Angular.

Sign up to request clarification or add additional context in comments.

Comments

0

Right way is to create directive for calling jquery plugins. But if it's quick fix you can inject $element into controller. Here related question.

Comments

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.