my main directory folder name is angularjs
and there have many files, file lists are given billow.
1.index.html
2.main.html
3.blue.html
4.red.html
5.green.html
i want to create routing using AngularJs, i have do that but facing error what i have wrong.
var app = angular.module("myApp", ["ngRoute"]);
app.config(function($routeProvider) {
$routeProvider
.when("/", {
templateUrl: "index.html"
})
.when("/red", {
templateUrl: "red.html"
})
.when("/green", {
templateUrl: "green.html"
})
.when("/blue", {
templateUrl: "blue.html"
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular-route.min.js"></script>
<body ng-app="myApp">
<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>
</body>
and i want to remove #
simble from routing path