I expected to see this question on Stackoverflow, but did not. Apparently, I'm the only one who has this problem, which seems to me very common.
I have a basic project I'm working on, but the routes do not seem to work, although everything I have done so far seems to be correct.
I have this html piece in my index.html file:
<html> <head ng-app="myApp"> <title>New project</title> <script src="https://code.angularjs.org/1.6.0/angular.min.js"></script> <script src="https://code.angularjs.org/1.6.0/angular-route.min.js"></script> <script src="app.js"></script> </head> <body> <a href="#/add-quote">Add Quote</a> <div ng-view ></div> </body> </html>
and here is my app.js :
var app = angular.module('myApp', ['ngRoute']); app.config(['$routeProvider', function ($routeProvider) { $routeProvider .when('/add-quote', { templateUrl: 'views/add_quote.html', controller: 'QuoteCtrl' }) .otherwise({ redirectTo: '/' }); }]);
Now, when I just went to the page, here is what I get in the URL:
http: // localhost: 8000 / admin #! /
and when I click the Add quote button, I get the following:
http: // localhost: 8000 / admin #! / #% 2Fadd-quote
What could be the problem? thanks for the help
Awa Melvine Dec 18 '16 at 19:09 2016-12-18 19:09
source share