I'm starting with a basic app with c# web api + AngularJS. I'm using AngularJS ngRoute for routing. The page is perfectly loaded, and the code in the secondary files is displayed correctly. The problem is with the file (or code) templated with ngRoute... here is my code...
my app.js:
var App = angular.module('App', ['ngRoute']);
// configure our routes
App.config(function ($routeProvider) {
$routeProvider
// route for the home page
.when('/', {
templateUrl: 'views/home.html'
})
.otherwise({ redirectTo: '/' });
$locationProvider.html5Mode(true);
});
my Index.html:
<body class="hold-transition skin-blue sidebar-mini" ng-app>
<div class="wrapper">
<!-- Header -->
<header class="main-header" ng-include src="'views/common/header.html'"></header>
<!-- Menú Principal -->
<aside class="main-sidebar" ng-include src="'views/common/sidebar.html'"></aside>
<!-- Contenido de la página -->
<div class="content-wrapper" ng-view>
</div>
<!-- Footer -->
<footer class="main-footer" ng-include src="'views/common/footer.html'"></footer>
</div>
i wasn't passing the dependency injection for $routeProvider. I change it and then i change ng-app for ng-app="App" and start working fine. Thanks all!