jquery function not working in my controller

3,919 views
Skip to first unread message

Abdul Azeez Shaik

unread,
Aug 14, 2012, 1:21:25 PM8/14/12
to ang...@googlegroups.com
Dear all,

I am calling a jquery function in below way in one of my controller,

$.growlUI('Growl Notification', 'Have a nice day!');

However, this one doesn't get called. Required JS files for this is already added to the template.

Can't we access jquery functions in my controller function?

Thanks,

Abdul

PS: i am trying to use this jquery function given in following link, http://jquery.malsup.com/block/#demos

Abdul Azeez Shaik

unread,
Aug 14, 2012, 2:03:17 PM8/14/12
to ang...@googlegroups.com
I tried using jQuery.growUI as well. still it didn't work for me.
Can you please let me know your suggestions to resolve this issues?

Michael Bielski

unread,
Aug 14, 2012, 2:05:19 PM8/14/12
to ang...@googlegroups.com
Put this in the same file as your controller, but outside (above) the controller:

var $jq = jQuery.noConflict();

You should now be able to use $jq in place of $. and everything should work just fine.

Abdul Azeez Shaik

unread,
Aug 15, 2012, 12:19:44 AM8/15/12
to ang...@googlegroups.com
Yes, its working after using noConflict(). Thanks for providing the information Micheal.

Thanks once again,
Abdul

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en.
 
 

curiou...@gmail.com

unread,
Aug 15, 2012, 6:13:41 AM8/15/12
to ang...@googlegroups.com
Is this the recommended way of using jQuery with AngularJS? That is, in the angularJS applications, if one is also planning to use jQuery, should one declare var $jq = jQuery.noConflict(); and work with that. 

Thanks.
Reply all
Reply to author
Forward
0 new messages