Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routes in components (navbar) not working in prod #413

Closed
DocBradfordSoftware opened this issue Mar 11, 2016 · 3 comments
Closed

Routes in components (navbar) not working in prod #413

DocBradfordSoftware opened this issue Mar 11, 2016 · 3 comments

Comments

@DocBradfordSoftware
Copy link

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.

@DocBradfordSoftware
Copy link
Author

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

@PatrickJS
Copy link
Owner

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")
mishoo/UglifyJS#999
angular/angular#6678

@DocBradfordSoftware
Copy link
Author

That makes perfect sense, Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants