在angular.js上使用HTML5 pushstate
我正在尝试实现html5的pushstate而不是Angularjs使用的#导航。我已经尝试过在Google上寻找答案,还尝试了没有运气的有角度的irc聊天室。 这是我的controllers.js: function PhoneListCtrl($scope, $http) { $http.get('phones/phones.json').success(function(data) { $scope.phones = data; }); } function PhoneDetailCtrl($scope, $routeParams) { $scope.phoneId = $routeParams.phoneId; } function greetCntr($scope, $window) { $scope.greet = function() { $("#modal").slideDown(); } } app.js angular.module('phoneapp', []). config(['$routeProvider', function($routeProvider){ $routeProvider. when('/phones', { templateUrl: 'partials/phone-list.html', controller: PhoneListCtrl }). when('/phones/:phoneId', { templateUrl: 'partials/phone-detail.html', controller: …