Javascript AngularJS登录后重定向
是我。。。再一次。。。 嗯,当登录成功时,我需要在控制器上设置AngularJS重定向。我读过一本书,我发现。这个例子很清楚使用ui路由器,非常简单。 我将我的应用程序的所有代码“base”放在index.html上,并添加一个div:Javascript AngularJS登录后重定向,javascript,html,angularjs,Javascript,Html,Angularjs,是我。。。再一次。。。 嗯,当登录成功时,我需要在控制器上设置AngularJS重定向。我读过一本书,我发现。这个例子很清楚使用ui路由器,非常简单。 我将我的应用程序的所有代码“base”放在index.html上,并添加一个div: <body ng-app="solempApp"> <!-- Start of first page --> <div ui-view></div> </body> 问题是当我将url
<body ng-app="solempApp">
<!-- Start of first page -->
<div ui-view></div>
</body>
问题是当我将url放在web浏览器上时:
http://192.168.0.203/solempmobile
返回:
http://192.168.0.203/solempmobile/#/solempmobile
所有的一切都在一张空白的纸上。web服务器是IIS,应用程序位于虚拟目录上。主页是。
我做错什么了吗
[更新1]
因此,我已经环顾了代码,最后它的工作。。。布乌特。。。。。不是以预期的方式。这条路线有效。。。但是与jquery mobile相关的ccs没有。
我不得不推迟:
<div data-role="page">
在部分视图之外,但是页面太难看了…你可以简单地使用HTML重定向!所以首先制作一个简单的HTML文件,称之为index.HTML 然后在主页“/”中设置一个状态,如下所示:
.config(function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/solempmobile');
$stateProvider
// HOME STATES AND NESTED VIEWS ========================================
.state('Home', {
url: '/'
templateUrl: 'index.html'
})
.state('solempmobile', {
url: '/solempmobile',
templateUrl: 'login.html'
})
// ABOUT PAGE AND MULTIPLE NAMED VIEWS =================================
.state('about', {
// we'll get to this in a bit
});
})
然后在你的index.html中:你可以有一个自动重定向的元标记。。。Idk如果这是正确的url,但您可以更改它:
<html>
<head>
<META http-equiv="refresh" content="5;URL=http://192.168.0.203/solempmobile/#solempmobile/solempmobile">
<!-- Type in whatever HTTPS you want to go to. In your case your login page... -->
</head>
</body>
</html>
希望这有帮助 嗨,我的朋友!谢谢你的帮助。现在我把aaaaall de project放在一个旧文件夹中,因为我怀疑jqery mobile与angularJS不兼容。查看我的更新1…此工作。。。但我发现AngularJS和jQuery Mobile还不具备兼容性,它们很快就会具备@阿利布里塞尼奥
<html>
<head>
<META http-equiv="refresh" content="5;URL=http://192.168.0.203/solempmobile/#solempmobile/solempmobile">
<!-- Type in whatever HTTPS you want to go to. In your case your login page... -->
</head>
</body>
</html>