苗火 Nicholas
[angularJS]An example about angular-ui-router
2015-9-16 萧


<html ng-app='myApp'>

<script src="js/angular.min.js" ></script>

<script src="../framework/angular-ui-router.js"></script>

<!-- in index.html -->

<body >

<section ui-view></section>

</body>

<script>

angular.module('myApp', ['ui.router']).config( function( $stateProvider){



 $stateProvider

  .state('contacts', {

   url:'/contacts',

     template: '<h1>My Contacts</h1>'

  })

  .state('page1', {

   url:'/page1',

   templateUrl:'template/page-1.html' 

  });



});

</script>

</html>

发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容