I have little confusion. Using Nodejs
folder image structure attached.
If I put index.html in the root of the client folder, than everything works fine.
On the other hand, if I move index.html in the views folder, as in the image, than js files are not loading, and index.html is loading.
Nodejs - server.js
app.configure(function () { app.set('port', process.env.PORT || 3000); app.use(express.favicon()); app.use(express.cookieParser()); app.use(express.bodyParser()); app.use(express.logger('dev'));
app.js
app.config(['$routeProvider', function ($routeProvider) { $routeProvider.when('/', { templateUrl: 'partials/home.html', controller: 'HomeCtrl' }); $routeProvider.when('/login', { templateUrl: 'partials/login.html', controller: 'LoginCtrl' }); $routeProvider.when('/register', { templateUrl: 'partials/register.html', controller: 'RegisterCtrl' }); $routeProvider.when('/404', { templateUrl: 'partials/404.html' }); $routeProvider.otherwise({redirectTo: '/404'}); //$locationProvider.html5Mode(true); }])
index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html ng-app="contactManager"> <head> <meta charset="utf-8"> <title>Angular Demo</title> </head> <body> <a href="#/">Home</a><br/> <a href="#/login">Login</a><br/> <a href="#/register">Register</a><br/> <a href="#/private">Private</a><br/> <a href="#/admin">Admin</a><br/> <a href="#/404">404</a><br/> <div> <div ng-view></div> </div> <script src="../lib/vendor/angularjs/1.1.5/angular.min.js"></script> <script src="../js/app.js"></script> <script src="../js/controllers.js"></script> </body>


source share