J
J
jenya77712016-12-05 19:43:05
Angular
jenya7771, 2016-12-05 19:43:05

How to remove the hash in ui route?

How to remove the hash mark in the address in ui route?
Doesn't work in this version.

var myApp = angular.module('myApp', ['ui.router']);
    myApp.config(function($stateProvider, $urlRouterProvider) {
   $locationProvider.html5Mode(true);

  $urlRouterProvider.otherwise('/home/normal');
  $stateProvider
  .state('home', {
    url: '/home',
    templateUrl: 'templates/home.php',
    controller: 'homeCtrl'
  })
  .state('home.normal', {
    url: '/normal',
    templateUrl: 'templates/normal.php',
    controller: 'homeCtrl'
  })
    .state('home.extended', {
    url: '/extended',
    templateUrl: 'templates/extended.php',
    controller: 'extendedSearchCtrl'
  })

  .state('home.office', {
    url: '/:office',
    templateUrl: 'templates/office.php',
    controller: 'officeCtrl'
  })
  .state('group', {
    url: '/group/:namegroup',
    templateUrl:'templates/schedule.php',
    controller:'scheduleCtrl'
  });
});

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question