Click here to Skip to main content
15,886,639 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
PHP
var app = angular.module("ApplicationModule", ["ngRoute"]);

   //The Factory used to define the value to
   //Communicate and pass data across controllers

   app.factory("ShareData", function () {
       return { value: 0 }
   });

   //Defining Routing
   app.config(['$routeProvider','$locationProvider', function ($routeProvider,$locationProvider) {
       $routeProvider.when('/showemployees',
                           {
                               templateUrl: 'EmployeeInfo/ShowEmployees',
                               controller: 'ShowEmployeesController'
                           });
       $routeProvider.when('/addemployee',
                           {
                               templateUrl: 'EmployeeInfo/AddNewEmployee',
                               controller: 'AddEmployeeController'
                           });
       $routeProvider.when("/editemployee",
                           {
                               templateUrl: 'EmployeeInfo/EditEmployee',
                               controller: 'EditEmployeeController'
                           });
       $routeProvider.when('/deleteemployee',
                           {
                               templateUrl: 'EmployeeInfo/DeleteEmployee',
                               controller: 'DeleteEmployeeController'
                           });
       $routeProvider.otherwise(
                           {
                               redirectTo: '/'
                           });
      // $locationProvider.html5Mode(true);
       $locationProvider.html5Mode(true).hashPrefix('!')
   }]);




I got this error in browser console
Error: [$location:nobase] $location in HTML5 mode requires a <base> tag to be present!
http://errors.angularjs.org/1.3.16/$location/nobase
at angular.js:63
at $LocationProvider.$get (angular.js:11384)
at Object.invoke (angular.js:4219)
at angular.js:4037
at getService (angular.js:4178)
at Object.invoke (angular.js:4210)
at angular.js:4037
at getService (angular.js:4178)
at Object.invoke (angular.js:4210)
at angular.js:6556(anonymous function) @ angular.js:11699
http://localhost:11111/__browserLink/requestData/10da8e4ba855456d8191af0b0dd4e06f Failed to load resource: the server responded with a status of 404 (Not Found)
Posted
Updated 14-Sep-16 6:39am

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900