0
给定一个空文档,只需最基本的要素,装载JS文件和样式表:在载入控制器角局部视图入空文档
<!doctype html>
<html ng-app="labApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.6/angular.min.js"></script>
<script src="/static/lab.js"></script>
<link rel="stylesheet" href="/static/local.css" />
<link rel="stylesheet" href="/static/superhero.min.css" />
</head>
<body ng-controller="labController">
</body>
</html>
而在lab.js空控制器:
angular.module('labApp', [])
.controller('labController', function() {
var lab = this;
});
我如何着手将局部视图加载到身体中? 我应该这样做手动,使用jQuery,还是有一些隐藏的角度来加载部分? https://github.com/angular-ui/ui-router
当加载到你的应用程序,你可以将其包含这样的
angular.module('app', [ui.router])
当您按照它是相当的文档:
你可能要考虑使用ui路由器:https://github.com/angular-ui/ui-router – Michelangelo
啊,是的,这似乎是失踪的齿轮..请添加一个答案,以便我可以接受它^ _ ^ –