I am developing a web application with AngularJS for the front end, and I am trying to configure routing and showing views, while even ng-include and other things work for me, but not ng-view. I develop in the visual studio, and when I launch the application using local server (localhost)
here is my directory structure
- ASP.NET project ---- Css ---- Scripts -------- App -------- app.js ----------- Home -------------- Controllers ------------------ index-controller.js ---- Views ------- Partials ---------- navbar.html ------- home.html - index.html
Here is mi index.html
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Scolaris</title> <link type="text/css" rel="stylesheet" href="Content/materialize/css/materialize.css" media="screen,projection" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> </head> <body ng-app="app_module"> <ng-include src="'Views/Partials/navbar.html'"/> <div ng-view></div> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="Content/materialize/js/materialize.js"></script> <script type="text/javascript" src="Scripts/angular.js"></script> <script type="text/javascript" src="Scripts/angular-route.js"></script> <script type="text/javascript" src="Scripts/App/app.js"></script> <script type="text/javascript" src="Scripts/App/Home/Controllers/index-controller.js"></script> <script type="text/javascript" src="Scripts/initialization.js"></script> </body> </html>
Here is my app.js
'use strict'; var app_module = angular.module('app_module', ['ngRoute']); app_module.config(['$routeProvider', function ($routeProvider) { $routeProvider .when('/', { templateUrl: '/Views/home.html', controller: 'indexController' }) .otherwise({ redirectTo: '/' }); }]);
When I load the site, it loads correctly, and if I see the requests, I can clearly see that it is requesting home.html with a status code of 304, the thing is a div with ng-view that does not show html inside the house. html, what could it be because of?
source share