Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="app">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.15/angular-ui-router.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <div ui-view="header"></div>
  <div ui-view="content"></div>
  <div ui-view="footer"></div>
</body>
</html>
 
angular.module('app', ['ui.router'])
.config(function($stateProvider) {
  $stateProvider.state('myapp', {
    views: {
      'header': {
        template:'header <hr />'
      },
      'content': {
        template:'<div ui-view></div>'
      },
      'footer': {
        template:'<hr /> footer'
      }
    }
  })
  .state('myapp.one', {
    template:'sup <button ui-sref="myapp.two">next page</button>'
  })
  .state('myapp.two', {
    template:'another page <button ui-sref="myapp.one"> Go back</button>'
  })
})
.run(function($state) {
  $state.go('myapp.one');
})
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers