cd "multipage-template"
python -m SimpleHTTPServer 8080
<!-- about.html -->
<div>
<p>This is what we want to load on the "about" tab</p>
</div>
<!-- Index.html -->
<body>
<div ng-app="myApp">
<div>Header content</div>
<!-- This is where your fragment will load -->
<div ui-view></div>
<div>Footer content</div>
</div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.15/angular-ui-router.js"></script>
var myApp = angular.module('myApp', ['ui.router'])
myApp.config(function($stateProvider) {
})
$stateProvider.state('home', { // Landing page
url:'/',
templateUrl: 'templates/home.html', // HTML fragment
controller: 'HomeController', // Which controller
})
// Config route provider
.config(function($stateProvider) {
$stateProvider
.state('home', {
url:'/',
templateUrl: 'templates/home.html',
controller: 'HomeController',
})
// Configure states for "content" and "about"
})
.controller('AboutController', function($scope){
$scope.info = "Some info"
})
<div>Here is the {{info}}</div>
.state('about', {,
url:'/about',
templateUrl: 'templates/about.html',
controller: 'AboutController',
})
// Landing page controller: define $scope.number as a number
// About page controller: define $scope.about as a string
// Content controller: define $scope.url as an image
<div>Some code</div>
<!-- Controller specified in you configuration -->
<div>Like using {{expressions}}</div>
<!-- Write an expression to see your $scope.number variable -->
<!-- Write an expression that shows your "about" variable -->
<!-- Use an img tag to show the image URL your defined in your controller -->
<a ui-sref="home">Home</a>
<div class="header">
<!-- Create links to different sections -->
<h1>This is the header -- it'll stick around</h1>
<a class="btn btn-default">Home</a>
<a class="btn btn-default">Content</a>
<a class="btn btn-default">About</a>
</div>
Project proposal (due next week)