Ceejay
Ceejay

Reputation: 7267

Jquery not working for the content inside the ng-view element

I am using AngularJS to build SPA(single page app).i have multiple pages which has linked to jquery.js. when i run the pages separately all the jquery functions successfully executing, but when i access those files from the ng-view element. the jquery from other pages is not at all executing. What may be the problem?

Upvotes: 2

Views: 924

Answers (2)

Ceejay
Ceejay

Reputation: 7267

I solved it by just removing

$(document).ready(function(){    });

which is inside the embedded pages. Now jquery in all other pages is working fine.

Upvotes: 1

Bwaxxlo
Bwaxxlo

Reputation: 1880

You should use angular.element('#element') instead of jQuery(#element) or $(#element). Any manipulation done with jQuery might not be reflected in your angular state.

Upvotes: 0

Related Questions