Skip to content

Instantly share code, notes, and snippets.

@gmittica gmittica/index.html
Created Oct 16, 2017

Embed
What would you like to do?
JS Bin // source http://jsbin.com/rejixi
<!DOCTYPE html>
<html>
<head>
<script src="https://rawgit.com/angular/bower-angular/master/angular.min.js"></script>
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="http://unpkg.com/@uirouter/angularjs@1.0.7/release/angular-ui-router.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body ng-app="myApp">
<div class="container">
<div class="well">
<a ui-sref="user-list" class="btn btn-link">Home</a>
<a ui-sref="user-contact" class="btn btn-link">Contact</a>
</div>
<ui-view></ui-view>
</div>
<script id="jsbin-javascript">
angular.module("myApp", ['users'])
.config(['$urlRouterProvider', function($urlRouterProvider) {
$urlRouterProvider.otherwise('/');
}]);
angular.module("users", ['ui.router'])
.config(['$stateProvider', function($stateProvider) {
var s1 = {
name: 'user-list',
url: '/',
template: '<h1>This is a view</h1>'
};
var s2 = {
name: 'user-contact',
url: '/users/contact',
template: '<h1>This is another view</h1>'
}
$stateProvider.state(s1);
$stateProvider.state(s2);
}]);
</script>
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html>
<html>
<head>
<script src="https://rawgit.com/angular/bower-angular/master/angular.min.js"><\/script>
<script src="https://code.jquery.com/jquery.min.js"><\/script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"><\/script>
<script src="//unpkg.com/@uirouter/angularjs@1.0.7/release/angular-ui-router.min.js"><\/script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body ng-app="myApp">
<div class="container">
<div class="well">
<a ui-sref="user-list" class="btn btn-link">Home</a>
<a ui-sref="user-contact" class="btn btn-link">Contact</a>
</div>
<ui-view></ui-view>
</div>
</body>
</html></script>
<script id="jsbin-source-javascript" type="text/javascript">angular.module("myApp", ['users'])
.config(['$urlRouterProvider', function($urlRouterProvider) {
$urlRouterProvider.otherwise('/');
}]);
angular.module("users", ['ui.router'])
.config(['$stateProvider', function($stateProvider) {
var s1 = {
name: 'user-list',
url: '/',
template: '<h1>This is a view</h1>'
};
var s2 = {
name: 'user-contact',
url: '/users/contact',
template: '<h1>This is another view</h1>'
}
$stateProvider.state(s1);
$stateProvider.state(s2);
}]);
</script></body>
</html>
angular.module("myApp", ['users'])
.config(['$urlRouterProvider', function($urlRouterProvider) {
$urlRouterProvider.otherwise('/');
}]);
angular.module("users", ['ui.router'])
.config(['$stateProvider', function($stateProvider) {
var s1 = {
name: 'user-list',
url: '/',
template: '<h1>This is a view</h1>'
};
var s2 = {
name: 'user-contact',
url: '/users/contact',
template: '<h1>This is another view</h1>'
}
$stateProvider.state(s1);
$stateProvider.state(s2);
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.