Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript angular.js上的HTML5 pushstate,下载文件的链接不起作用?_Javascript_Angularjs_Html_Pushstate - Fatal编程技术网

Javascript angular.js上的HTML5 pushstate,下载文件的链接不起作用?

Javascript angular.js上的HTML5 pushstate,下载文件的链接不起作用?,javascript,angularjs,html,pushstate,Javascript,Angularjs,Html,Pushstate,今天我尝试在我的应用程序中使用HTML5 pushstate来删除# 从…起 网址。为了实现这一点,我在路由器和 执行$locationProvider.html5Mode(true);正如我从 这么多在线资源。起初它不起作用,后来我把它拆了 所有的#都来自URL并添加到index.html中 Tts working fine for every url in whole application. In my application u can upload file and if file u

今天我尝试在我的应用程序中使用HTML5 pushstate来删除# 从…起 网址。为了实现这一点,我在路由器和 执行$locationProvider.html5Mode(true);正如我从 这么多在线资源。起初它不起作用,后来我把它拆了 所有的#都来自URL并添加到index.html中

Tts working fine for every url in whole application.
In my application u can upload file and if file uploaded successfully,
File name would be visible as a on the page and if u click on the
file name you would be able to download it.

MY PROBLEM is now in pushstate, if we click on file name nothing is 
happening. I tried multiple combination but no luck.
//Router.js
angular.module('myApp').config(函数($stateProvider、$urlRouterProvider、$locationProvider){
$stateProvider
.州(“家”{
url:“/”,
templateUrl:'app/main/main.html',
控制器:“MainCtrl”,
controllerAs:'mainCtrl'
})
$urlRouterProvider。否则('/');
$locationProvider.html5Mode(true);
});

{{fileModel.file.name}}

Update:当我右键单击文件名并选择“在新选项卡中打开链接”选项时,我就可以下载文件了。更新:当我右键单击文件名并选择“在新选项卡中打开链接”选项时,我就可以下载文件了。有没有其他方法可以达到这个目的?