PatrickJS-starter
PatrickJS-starter copied to clipboard
Routes in components (navbar) not working in prod
MyMenu Component
<nav class="navbar navbar-light navbar-full" style="background-color: #e3f2fd; z-index: 999;">
<ul class="nav navbar-nav">
<li class="nav-item" [ngClass]="{active: activeMenu == 'home'}">
<a class="nav-link" [routerLink]="['Home']">Home</a>
</li>
</ul>
</nav>
<my-menu [activeMenu]="'home'"></my-menu>
<div class="container-fluid">
<h4>Public View</h4>
<p>bla bla bla</p>
</div>
This will work in dev mode, but not in prod Note: I have stripped out bootstrap and jquery, just normal css.
I have added a repostitory that demonstrates this problem. This app will run in dev mode, but not in prod mode. angular2-webpack-starter-no-bs
this is a problem with Angular 2. You will need to add all components/directives to the except mangle list (in this case add "TopMenu")
https://github.com/mishoo/UglifyJS2/issues/999
https://github.com/angular/angular/issues/6678
That makes perfect sense, Thanks