这是代码。在URL中,它正在重定向到#!/dashboard
,但未显示任何内容。
var app = angular.module("myapp", ["ngRoute"]);
app.config(function ($routeProvider) {
$routeProvider.when("/", {
templateUrl: "Login.html"
}).when("/dashboard", {
tepmlateUrl: "Dasu.html"
});
});
app.controller("LoginCtrl", function ($rootScope, $location, $scope) {
$scope.submit = function()
{
debugger;
if($scope.userid == 'admin' && $scope.password == 'admin')
{
$rootScope.LoggedIn = true;
$location.path('/dashboard');
}
}
});
答案 0 :(得分:1)
您的$ routeProvider配置中有打字机
.when("/dashboard", {
tepmlateUrl: "Dasu.html"
});
应该是
.when("/dashboard", {
templateUrl: "Dasu.html"
});