Reputation: 4234
Have just finished an awesome angular js app. Now I want to do a welome page from where you can start the application. Problem is I'm not really sure how to solve this in my routeprovider since my index.html is combined with dynamically nested views and static content. Is there anyway I can just point to a totally diffrent page (welcome.html) when url is on root (/)?
$routeProvider
.when('/', {
//send me to diffrent page
});
Upvotes: 0
Views: 1140
Reputation: 13918
Sure, you can do it like this:
var myApp = angular.module('myApp', []).
config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/', {templateUrl: 'welcome.html', controller: 'WelcomeController'});
$routeProvider.when('/main', {templateUrl: 'index.html', controller: 'MainAppController'});
$routeProvider.otherwise({redirectTo: '/'});
}]);
This configuration will route all urls other then /main
to welcome.html
page.
Upvotes: 1