Skip to content

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

Closed

Description

@DocBradfordSoftware

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.

Activity

  1. DocBradfordSoftware commented on Mar 11, 2016

    @DocBradfordSoftware
    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

  2. PatrickJS commented on Mar 12, 2016

    @PatrickJS
    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

  3. DocBradfordSoftware commented on Mar 12, 2016

    @DocBradfordSoftware
    Author

    That makes perfect sense, Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions