0

I have very simple code

<!DOCTYPE html>
<html ng-app="app">
  <head>
    <link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="assets/css/app.css" />
    <script type="text/javascript" src="assets/js/angular.min.js" />
    <script type="text/javascript" src="assets/js/app.js" />
  </head>
  <body>
    asdfasdf
    {{1+2}}
  </body>
</html>

and I'm pretty sure everything is pointing to the right directory. My app.js is:

( function () {

  var app = angular.module( 'app' , [] );

}) ();

However, opening index.html on localhost all I can see is a blank page but when I delete the lines

    <script type="text/javascript" src="assets/js/angular.min.js" />
    <script type="text/javascript" src="assets/js/app.js" />

I get a page that says "asdfasdf {{1+2}}" How can I get angular working? Is there a big mistake I'm making somewhere?

2
  • 1
    There should be an error in your console, hit F12, reload page and see what it is. Commented Jul 1, 2014 at 7:18
  • There will be no error in the console because your script tags are self-closing, and as pointed out below they shouldn't be. The network tab in your dev tools would show it NOT loading the script files though. Commented Jul 1, 2014 at 8:04

1 Answer 1

1

Script tags must have an end tag. They cannot be self-terminating.

 <script type="text/javascript" src="assets/js/app.js"></script>
Sign up to request clarification or add additional context in comments.

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.