i'm trying to set up the first example linked here: https://www.w3schools.com/angular/angular_routing.asp the example that contains the colors.
<p><a href="#/!">Main</a></p>
<a href="#!red">Red</a>
<a href="#!green">Green</a>
<a href="#!blue">Blue</a>
<div ng-view></div>
<script>
var app = angular.module("myApp", ["ngRoute"]);
app.config(function($routeProvider) {
$routeProvider
.when("/", {
templateUrl : "main.htm"
})
.when("/red", {
templateUrl : "red.htm"
})
.when("/green", {
templateUrl : "green.htm"
})
.when("/blue", {
templateUrl : "blue.htm"
});
});
</script>
</body>
If i used template and put HTML in, it works completely fine but when ever I use templateUrl(i do have all of the .htm files set up) it can never find the .htm pages.
My directory is setup as
C:\Users{User}\Documents\ng-Route and all of the .htm files are children of the ng-route folder.
Whenever I click a link, the url goes from: ...ng-Route/index.html#! to ng-Route/index.html#!/green but the partial view doesn't get displayed. Any help would be dearly appreciated.