-1

I would like to that way, if it exists, how to do that, ng-view (or ui view) loads, when load the page. For example: I would like to seperate header files, menu files, etc. So the Webpage should stands some views. I found only tutorials when views load after a click. Please inform me about this.

Thank you.

ktom
  • 228
  • 1
  • 3
  • 11

1 Answers1

0

When you build your router you specify which template to show for every route. You can also create a default one like so:

.config(function($routeProvider) {
        $routeProvider

            // route for the home page
            .when('/', {
                templateUrl : 'pages/home.html',
                controller  : 'mainController'
            })

            // route for the about page
            .when('/about', {
                templateUrl : 'pages/about.html',
                controller  : 'aboutController'
            })

            // route for the contact page
            .when('/contact', {
                templateUrl : 'pages/contact.html',
                controller  : 'contactController'
            })
            .otherwise({redirectTo: '/'});
    });
Dennis Nerush
  • 5,473
  • 5
  • 25
  • 33