Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

ROUTING & NAVIGATION - RouterLink section example does not work #2084

@WonSong

Description

@WonSong

https://angular.io/docs/ts/latest/guide/router.html#!#router-link

Below code example does not work:

<h1>Component Router</h1>
<nav>
    <a routerLink="/crisis-center" routerLinkActive="active">Crisis Center</a>
    <a routerLink="/heroes" routerLinkActive="active">Heroes</a>
</nav>
<router-outlet></router-outlet>

This worked:

<h1>Component Router</h1>
<nav>
    <a [routerLink]="['/crisis-center']" routerLinkActive="active">Crisis Center</a>
    <a [routerLink]="['/heroes']" routerLinkActive="active">Heroes</a>
</nav>
<router-outlet></router-outlet>

Also, it does not mention having to use import { ROUTER_DIRECTIVES } from '@angular/router';
and directives: [ROUTER_DIRECTIVES].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions