Marc Rasmussen Marc Rasmussen - 7 months ago 42
AngularJS Question

Angular JS ui router templates error

I have the following routes:

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


Then my project looks something like this:

enter image description here

AS you can see i have a template called "
" this template looks like this:

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

However when i run this it loads the index.html as my template and doesnt use this

Can anyone tell me what ive done wrong? and why this might be happening?

Answer Source

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

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

For more information about it read it's document.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download