K
K
Kaunov_ivan2015-08-27 16:15:41
Angular
Kaunov_ivan, 2015-08-27 16:15:41

Why doesn't angular-routes work?

I am running the application locally. I am using OpenServer.
routes.js:

angular.module('Todolist')
.config(function($routeProvider){
  $routeProvider.when('/todolist', {
    templateUrl: '/templates/list.html'
  })
});

app.js: And it gives an error not even to the console, but to the screen:
angular.module("Todolist", ['ngRoute']);

Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
test
08/27/15 16:14:46
Apache/2.2.29 (Win32)

Maybe the problem is in the server settings?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kaunov_ivan, 2015-08-27
@Kaunov_ivan

This .htaccess setting worked well for me
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/$
RewriteRule (.*) /#!/$1 [NE,L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question