My application utilizes the selector portfolio-app
and includes two stylesheets -
'../app/styles/templateMobile.css', '../app/styles/templateOther.css'
When I initially access my app from the default URL (localhost:3000 ATM), the stylesheets are properly applied. However, if I navigate to a different route and then refresh the page (F5), the template styles do not display correctly. This issue persists even when starting on a different route.
No error messages are appearing in the console.
I have tested this across multiple browsers including Firefox, Chrome, Safari, incognito mode, and with cleared browser cache. Additionally, I tested on various devices such as an LG G2, iPhone, iPad, and android emulators like Nexus 9, Nexus 10, Galaxy Nexus - always encountering the same result.
app.component:
import { Component } from 'angular2/core';
import {ViewEncapsulation} from 'angular2/core';
import { ROUTER_PROVIDERS, ROUTER_DIRECTIVES, RouteConfig } from 'angular2/router';
import { LandingComponent } from './landing.component';
import { PortfolioComponent } from './portfolio.component';
import { PagesService } from './pages.service';
@Component({
selector: 'portfolio-app',
templateUrl: '/app/views/template.html',
styleUrls: ['../app/styles/templateMobile.css', '../app/styles/templateOther.css'],
encapsulation: ViewEncapsulation.None,
directives: [ROUTER_DIRECTIVES],
providers: [ROUTER_PROVIDERS, PagesService]
})
@RouteConfig([
{ path: '/landing', name: 'Landing', component: LandingComponent, useAsDefault: true },
{ path: '/portfolio', name: 'Portfolio', component: PortfolioComponent }
])
export class AppComponent {
landing = true;
portfolio = false;
changeMiniNavLanding = function () {
this.landing = true;
this.portfolio = false;
}
changeMiniNavPortfolio = function () {
this.landing = false;
this.portfolio = true;
}
}
main.ts :
import {bootstrap} from 'angular2/platform/browser';
import {AppComponent} from './app.component';
bootstrap(AppComponent);
If you require further information, feel free to ask or explore the gitHub repository. (all relevant files are located in the app folder).
Thank you for your assistance.