kite

TA还未设置签名

Angular ui-router

所属分类:代码

699 0 6

资源描述
Angular ui-router 入门
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>Document</title>
<link rel="stylesheet" href="../css/resource.css" />
<script src="../js/angular.min.js"></script>
<script src="../js/angular-ui-router.min.js"></script>
</head>
<body data-ng-app="myApp">

<h1>Angular ui-route</h1>
    <div data-ui-view=""></div>
    
    <script>
     var myApp = angular.module("myApp", ["ui.router"]);
 
myApp.config(function ($stateProvider, $urlRouterProvider) {

    $urlRouterProvider.when("", "/indexTab");
 
    $stateProvider
       .state("indexTab", {
           url: "/indexTab",
           templateUrl: "indexTab.html"
       })
       .state("indexTab.index1", {
           url:"/index1",
           templateUrl: "index1.html"
       })
       .state("indexTab.index2", {
           url:"/index2",
           templateUrl: "index2.html"
       })
       .state("indexTab.index3", {
           url:"/index3",
           templateUrl: "index3.html"
       });
});
     
    </script>
</body>
</html>


资源推荐
0 /1000