2

Good afternoon everyone,

I started AngularJS a few days ago and, if I usually find my all answers here, I have a mysterious error...

Here is the evil error:

Error in event for (unknown): SyntaxError: Unexpected < extensions::uncaught_exception_handler

Here is for my code:

HTML (index.html)

<script src="/app/main.controller.js" type="text/javascript" charset="utf-8"></script>
<script src="/app/controllers/test.controller.js" type="text/javascript" charset="utf-8"></script>

<a href="#/">Home</a>
<a href="#/design">Design</a>

ANGULAR (main.controller.js)

function RouteProvider ($routeProvider) {
    $routeProvider

    .when("/", {
    templateUrl: "/app/views/home.html",
    controller: "homeCtrl"
    })

    .when("/design", {
    templateUrl: "/app/views/design.html",
    controller: "testCtrl"
    })

    .otherwise({
    redirectTo: "/"
    });
}

STRUCTURE

index.html
/app
 main.controller.js
 /controllers
 /views

This is the part of the code concerned by my route config.

The error happens whenever I activate the links above...

Thank you for your time!

(It's my first post, sorry if it's messy and if you need more code juste ask and I'll add it :])

  • Normally when that happens to me, it is because I have my server set to return my index page when it can't find anything. Then, when I load javascript with a bad URL, it loads that HTML file instead. – Dave Bush Feb 18 '16 at 15:11
  • Have you included the actual AngularJS source in `index.html`? – Ankh Feb 18 '16 at 15:13
  • Ankh - No the AngularJS code is in a js file if it's what you mean :/ – Romain Mascia Feb 18 '16 at 15:24
  • Dave Bush - It's a local server, I configured it in a way to target the index.html or the index.php file, do you think it's because of this? – Romain Mascia Feb 18 '16 at 15:25

0 Answers0