0

I've been trying to use JavaScript and jQuery to validate or to auto-fill forms inside ng-view.

I've read several articles like:

AngularJS ng-view not loading js jquery bxslider is not working with templates inside ng view Angularjs does not load scripts within ng-view

I have an app with has a master index page that display another page content through ng-view

page (A) - display data from the database. page (b) - fill-out form page where I have my JavaScript and jQuery validation.

So far if I put jQuery after AngularJs my ng-view works and it displays data from the database correctly, but my JavaScript doesn't work. If I do the opposite, including jQuery before AngularJs, my javascript works but page (a) gets this error message:

enter image description here

Gargaroz
  • 313
  • 9
  • 28
Photonic
  • 1,316
  • 19
  • 31
  • anything inside `ng-view` is replaced by the `view/template` – Tushar Jun 15 '15 at 07:46
  • 1
    If yo uwant to use jQuery & Angular, you need to include jQuery before Angular. As to the error you're getting, that's really hard to tell what the problem is without more information (show us some code of page A) – thomaux Jun 15 '15 at 08:01
  • It looks like you are calling a value inside an $http request but using the value without waiting the promise, because you have a value not defined. check how to wait for the promise in Angularjs. If you can put some code it could help us to give you the solution – z0r0 Jun 15 '15 at 08:13
  • Sorry folks my mistake. i had a test script inside my ng-view in (A) page. Forgot to delete it. But thanks Anzeo for the heads up – Photonic Jun 15 '15 at 08:43

0 Answers0