尝试学习AngularJS。我需要获得工作导航栏,但我无法理解如何在每个页面上获取内容。
主要HTML:
>>> t = classy.Task(direct=False)
about.html
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-route.js"></script>
<body ng-app="myApp">
<p>
<a href="#/">Main</a>
<a href="#about">About</a>
</p>
<div ng-view></div>
<script>
var app = angular.module("myApp", ["ngRoute"]);
app.config(function($routeProvider) {
$routeProvider
.when("/", {
templateUrl : "index.html"
})
.when("/about", {
templateUrl : "about.html"
})
});
</script>
</body>
</html>