0

I have the following routes:

    $stateProvider
    .state('access', {
        abstract: true,
        url: '/access',
        templateUrl: 'login.html'
    })
    .state('access.signin', {
        url: '/signin',
        templateUrl: 'tpls/signin.html',
        data: {
            authorizedRoles: [USER_ROLES.all]
        }
    });

$urlRouterProvider.otherwise('/access/signin');

Then my project looks something like this:

enter image description here

AS you can see I have a template called "login.html" this template looks like this:

<div class="logo">
    <a href="index.html">
        <img src="./assets/pages/img/logo-big.png" alt=""/> </a>
</div>
<!-- END LOGO -->
<!-- BEGIN LOGIN -->
<div class="content" ui-view>
</div>

However when I run this it loads the index.html as my template and doesn't use this login.html

What have I done wrong, and why might this be happening?

6
  • For template you don't need include js and css files. and also don't need ng-app and .... this template is similar to index.html file. see this sample and this sample Commented Aug 19, 2017 at 18:06
  • @Hadi ive udated my question Commented Aug 19, 2017 at 18:11
  • @Hadi what i am looking for is to change the layout completely. So that none of the html that is in index.html will be shown Commented Aug 19, 2017 at 18:14
  • You should use ui-view in index.html. Try checking the template path. Commented Aug 19, 2017 at 18:14
  • So use multiple views for this issue. see this Commented Aug 19, 2017 at 18:15

1 Answer 1

1

As you ask in your question to have multiple layouts in your app, so for this you should use Multiple Named Views.

 $stateProvider     
 .state('report', {     
   views: {     
   'filters': { ... templates and/or controllers ... },     
   'tabledata': {},     
   'graph': {},     
  }     
})  

For more information about it read it's document.

Sign up to request clarification or add additional context in comments.

Comments

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.