2017-08-06 27 views
0

如果不使用<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 
    } 
}) 
+0

通过这样做你想达到什么目的? – Shahzad

+0

考虑使用ui-router – Abhijeet

回答

0

这是在角度js应用中重定向的代码

$location.path('/dashboard');