Despite numerous attempts, I am still struggling to make a single controller function properly. Lately, I've been working on Angular projects and no matter what I do, my controllers just won't cooperate.
In my latest project, everything is within the same HTML file. Here is the complete code I have been working on:
<!DOCTYPE html>
<html lang="fr">
... (full code continued)
I am encountering 2 errors:
Uncaught SyntaxError: Unexpected token {
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.5.6/$injector/modulerr?p0=MyApp&p1=Error%3A%2…4-millenium.c9users.io%2Fnode_modules%2Fangular%2Fangular.min.js%3A21%3A19)
(which redirects to an Angular page regarding ngRoute that is quite confusing for me)
I've experimented with different approaches like creating a var app = angular.module(...)
, but it gives me an error stating that 'app' is not a function. I also tried enclosing the entire script inside a function()
, yet I still face the same issue.
I'm certain that I am overlooking something crucial, but I can't seem to pinpoint what it is.
Also, if you'd like to take a look at the full "working" project, here is a link to the Cloud9 project: