<p>
<span ng-click="clear()">清空缓存</span>
<span ng-click="info()">版本信息</span>
<span ng-click="check()">检查</span>
</p>
<script>
var app = angular.module("app",["ngRoute"]);
app.config(["$routeProvider", function ($routeProvider) {
$routeProvider.when("/content1",{template:"1111"})
.when("/check",{templateUrl:"child/check.html"})
.when("/clear",{templateUrl:"child/clear.html"})
.when("/info",{templateUrl:"child/info.html"})
.otherwise({redirectTo:"/content1"});
}])
</script>
<script>
app.controller("child3Controller",["$scope","$location", function ($scope,$location) {
$scope.check= function () {
$location.path("check");
};
$scope.clear= function () {
$location.path("clear");
};
$scope.info= function () {
$location.path("info");
};
}]);
</script>
通过AngularJS的来实现这种效果,写的代码看上去还是比较冗余,大家可以学习一下onsenUI中的写法,那就比较直接简单了!