I feel like I'm losing my mind because the answer should be so simple, I'm new to angular and nodejs and I'm trying to make an application that combines them both.
"Error: [$injector:nomod] Module 'myApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument."
public/controllers/Homecontroller:
(function () {
'use strict';
angular.module('myApp').controller('homeController', homeController);
function homeController() {
var vm = this;
vm.fillerData = "FillerData"
}
}) ();
public/Index.html:
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<meta charset="UTF-8">
<title>Dit is de index</title>
<script src="res/js/angular.js" type="text/javascript" defer="defer"></script>
<script src="controllers/homeController.js" type="text/javascript" defer="defer"></script>
</head>
<h1>What</h1>
<body ng-controller="homeController as homeCtrl">
{{ homeCtrl.fillerData }}
</body>
</html>
router/index.js:
var router = require('express').Router();
router.get('/index', function (req, res) {
res.sendfile('public/index.html');
});
router.get('/home', function (req, res) {
res.sendfile('public/home.html');
});
module.exports = router;
and /server.js:
var express = require('express');
var app = express();
var routes = require('./router');
app.use(express.static(__dirname + '/public'));
app.use('/', routes);
require('router/index.js')(app);
app.listen(3000);
console.log("App listening on port 3000");
All the necessary packages have been installed as well, any help would be appreciated