I have 4 pages in my application:
- login.html: full body login page.
- base.html: just simple page contains ui-view tag only to accommodate other views.
- main.html: contains menu header footer
- dashboard: contains some panels charts etc
Following is how I declared the routes:
$stateProvider
.state('base', {
abstract: true,
templateUrl: 'tpl/base.html'
})
.state('base.main', {
abstract: true,
templateUrl: 'tpl/main-layout.html',
})
.state('base.login', {
url: '/login',
templateUrl: 'views/login.html',
data: {
pageTitle: 'Login',
pageSubTitle: '',
}
})
// Dashboard
.state('base.main.dashboard', {
url: "/dashboard",
templateUrl: "views/dashboard.html",
data: {
pageTitle: 'Dashboard',
pageSubTitle: ''
}
})
The problem is these states are working fine; I am able to switch to any pages, but in the login page I have used jQuery backstretch plugin to show some image in the background.
So when I switch to other routes (such as dashboard) from login, other state pages show up fine, but the background image from login is still applied. If I refresh the page, then only that image get removed, and the original background for dashboard is displayed (original background is just a grey color defined in main-layout.html)
Can some one explains why background for login still visible on separate pages?