0

Body of my index page looks in the following way:

<body >
    <div ng-view></div>
</body>

I config my app in this way:

app.config(function($stateProvider, $urlRouterProvider, $locationProvider) {
        $urlRouterProvider.otherwise("/");
$stateProvider.state('login', {
    url: '/login',
    templateUrl: 'login.html'
    })
  .state('main', {
    url: '/',
    templateUrl: 'main.html'
  })

        $locationProvider.html5Mode(true);
    });

The content of my main.html file is:

<div>
    Example content
</div>

I would like my page to dispaly the content of main file when entering the main address. However, it is blank. What am I missing (I am new to angular)?

3
  • is there an error in the console? Commented Oct 17, 2017 at 18:33
  • no, there isn't Commented Oct 17, 2017 at 18:39
  • How do you bootstrap the app? there is no ng-app on the body at your example, so I guess its at the config too. more code would be helpful. Commented Oct 17, 2017 at 19:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.