Answer the question
In order to leave comments, you need to log in
How to properly set up a REST ful API?
when using html5Mode to discard the hash#, there is a problem with navigating to the address. I use a virtual server, the start page is localhost:9999 , in the config it looks like this
var portfolioApp = angular.module('portfolioApp', ['ngRoute', 'ngMaterial', 'portfolioControllers']);
portfolioApp.config(['$routeProvider', '$locationProvider',
function($routeProvider, $locationProvider) {
$locationProvider.html5Mode({
enabled: true,
requireBase: false
})
$routeProvider.
when('/', {
templateUrl: 'partials/home.html',
controller: 'HomeCtrl'
}).
when('/service', {
templateUrl: 'partials/service.html',
controller: 'ServiceCtrl'
}).
when('/works', {
templateUrl: 'partials/works.html',
controller: 'WorksCtrl'
}).
when('/about', {
templateUrl: 'partials/about.html',
controller: 'AboutCtrl'
}).
otherwise({
redirectTo: '/'
});
}
]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question