[英]Redirect to Index.html issue
单击时,我想转到index.html,例如,如果用户单击浏览器中的重新加载图标,它将通过使用ng-click重定向到index.html。 如何在Angular JS中实现
HTML:
<div ng="logoutcntrl">
<ons-button ng-click="logout()"></ons-button>
</div>
使用Javascript:
function logoutcntrl($scope){
$scope.logout= function(){
$location.path="index.html";
}
}
使用浏览器的本机window.location
对象及其href
属性:
function logoutcntrl($scope) {
$scope.logout= function() {
window.location.href = "index.html";
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.