我只是第一次嘗試UI路由器。這是我非常簡單的嘗試。所以我現在預計,只會顯示標題。但該頁面保持空白。我究竟做錯了什麼?UI路由器內聯模板
<!doctype html>
<html ng-app="myApp">
<head>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.14/angular-ui-router.min.js"></script>
<script>
var app = angular.module('myApp', ['ui.router']);
app.config(function($stateProvider, $urlRouterProvider) {
$stateProvider.state('index', {
template: '<h1>Header</h1>'
});
});
</script>
</head>
<body>
<main ui-view></main>
</body>
</html>
http://plnkr.co/edit/n3uX2SMR0puNROzRePOO適用於0.2.15版本的版本 – OzBob