如何使用angularJS启动html页面

如何使用angularJS启动html页面,angularjs,button,Angularjs,Button,我想做一个按钮,当我点击它时,启动一个html页面。我怎么做? 下面是一个不完整的例子: <button ng-model="status" ng-init="status=true" ng-click="status=!status"> <span ng-show="status == true" >Activo</span> <span ng-show="status == false">Desactivo</sp

我想做一个按钮,当我点击它时,启动一个html页面。我怎么做? 下面是一个不完整的例子:

<button ng-model="status" ng-init="status=true" ng-click="status=!status">    
    <span ng-show="status == true" >Activo</span>
    <span ng-show="status == false">Desactivo</span>
</button>

谢谢大家。

您可以使用一个简单的“a”标记来解决这个问题:

<a href="somepage.html">Lunch somepage.html </a>
您也可以使用angularjs解决此问题,以下是一个示例:

<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>

<div ng-app="myApp" ng-controller="myCtrl">

<button ng-model="status" ng-init="status=true" ng-click="myFunc()">
<span ng-show="status == true" >Activo</span>
    <span ng-show="status == false">Desactivo</span>
</button>


</div>

<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $window) {
    $scope.myFunc = function(){
        $scope.status = !$scope.status;

        $window.location.href = '/somepage.html'; //this will redirect you to somepage.html
    }

});
</script>

</body>
</html>

…那么你想要一个链接?你可能想买一个a作为午餐-贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾!!!发射贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾贾。