1
我正在寻找使用$ locationProvider api在我的项目中更改为html5mode。我如何将它注入指令?这是我现在有:
angular
.module('myApp')
.directive('errorModal', ['$location', ,
function($location, $locationProvider) {
//to expose locationProvider to the window
window.provider = $locationProvider;
}
但是,这给了locationProvider是未定义的。这里适当的语法是什么?