如果不使用<a href="#!dashboard">Some text</a>
,有没有可能调用“dashboard.html”?我不会从javascript调用“dashboard.html”。
app.config(function($routeProvider) {
$routeProvider
.when('/', {
templateUrl : 'loginRegister.html',
controller : 'loginRegister'
})
.when('/dashboard', {
templateUrl : 'dashboard.html',
controller : 'dashboard'
})
})
app.controller('loginRegister', function($scope, $http) {
$scope.showDashboard = function() {
// CALL dashboard.html FROM HERE
}
})
通过这样做你想达到什么目的? – Shahzad
考虑使用ui-router – Abhijeet