Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having an ng-view outside of ng-app should show a warning #40

Open
jeffmay opened this issue Dec 15, 2013 · 0 comments
Open

Having an ng-view outside of ng-app should show a warning #40

jeffmay opened this issue Dec 15, 2013 · 0 comments

Comments

@jeffmay
Copy link

jeffmay commented Dec 15, 2013

This is something that a friend of mine who is new to Angular got tripped up on for some time. I think it would be pretty easy to prevent this.

<html>
  <head ng-app>
  </head>
  <body ng-view>
  </body>
</html>

The ng-view could have a yellow background to indicate that the view is not inside the app.

Since you can bootstrap your app from JavaScript, it shouldn't show a warning on the following:

<html>
  <head>
  </head>
  <body ng-view>
  </body>
</html>

Because in that case, you don't have an ngApp on the page.

This might also go well with a warning when using two ngApp directives on the same page, since you cannot bootstrap Angular from the html if you have two ngApp directives on the same page (however, I don't know if this is something that is planned to change).

Just thought I would share. Thanks for the plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant