我是初学者,我无法在这里找到我做错的事,有人能帮帮我吗?
以下是我使用的代码
的index.html index.html
git worktree add
app.config.js(app.config.js的代码)
我使用ui.router。 app.config.html
<body ng-app="psJwtApp">
<!-- Add your site or application content here -->
<div class="header">
<div class="navbar navbar-default" role="navigation">
<div class="container">
<div class="collapse navbar-collapse" id="js-navbar-collapse">
<ul class="nav navbar-nav">
<li><a ui-sref="home">Home</a></li>
<li><a ui-sref="register">Register</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div ng-view></div>
</div>
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/app.js"></script>
<script src="scripts/controllers/main.js"></script>
<script src="scripts/app.config.js"></script>
<!-- endbuild -->
答案 0 :(得分:0)
var myApp = angular.module('psJwtApp', ['ui.router']);
myApp.config(function ($stateProvider, $urlRouterProvider){
$stateProvider.state("home", {
url: "#",
templateUrl: "home.html",
controller: "HomeCtrl"
}).state("register", {
url: "#",
templateUrl: "register.html",
controller: "registerCtrl"
});
});
myApp.controller('HomeCtrl', ['$scope', function($scope) {
}])
myApp.controller('registerCtrl', function($scope, $stateParams) {
})