Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/415.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.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 angularjs$window.location.href返回不带css的页面_Javascript_Angularjs_Cordova_Ionic Framework - Fatal编程技术网

Javascript angularjs$window.location.href返回不带css的页面

Javascript angularjs$window.location.href返回不带css的页面,javascript,angularjs,cordova,ionic-framework,Javascript,Angularjs,Cordova,Ionic Framework,我正在将index.html和子页面中的所有CSS和JS文件链接到templates目录中,但使用$window.location.href它只返回没有CSS样式的纯html页面 在按钮上,单击页面渲染精细。 你知道怎么解决这个问题吗 .controller('HomepageCtrl', function($scope, $window,$stateParams, $timeout, ionicMaterialInk, ionicMaterialMotion) { // Set Hea

我正在将index.html和子页面中的所有CSS和JS文件链接到templates目录中,但使用$window.location.href它只返回没有CSS样式的纯html页面

在按钮上,单击页面渲染精细。 你知道怎么解决这个问题吗

.controller('HomepageCtrl', function($scope, $window,$stateParams, $timeout, ionicMaterialInk, ionicMaterialMotion) {
    // Set Header
    $scope.got = function(){
    $window.location.href = '/tempelates/share.html';
    }
    $scope.$parent.hideHeader();

})
提前谢谢

$window.location.href

将重定向到应用程序外,您必须使用带有$location的路由。

您在应用程序中使用路由吗?我是否应该将其写为$location.href或$location.path,因为这两个都不起作用?@sam,我在这里做了一个示例