Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

348
Vistas
Template parse errors:Parser Error: Unexpected token - RouterLink

On the below error . Am getting template parse error on RouterLink .

What is the correct way to use the RouterLink in Angular 2 ?

      Unhandled Promise rejection: Template parse errors:Parser Error: Unexpected token / at column 2 in [[/events]] in ng:///t/e.html@30:46 ("r">
                 <ul class="nav nav-sidebar">
                    <li class="active"><a [ERROR ->][routerLink]="[/events]">Events</a></li>
                    <li><a [routerLink]="[/task"]>Tasks<"): ng:///t/e.html@30:46Parser Error: Unexpected token / at column 2 in [[/events]] in ng:///t/e.html@30:46 ("ebar">                     <ul class="nav nav-sidebar">
                    <li class="active">[ERROR ->]<a [routerLink]="[/events]">Events</a></li>
                    <li><a [routerLink]="[/task"]>Tas"): ng:///t/e.html@30:43, Directive tParser Error: Unexpected token / at column 2 in [[/events]] in ng:///t/e.html@30:46 ("ebar">
                 <ul class="nav nav-sidebar">
about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You have syntax error, you're using:

<a [routerLink]="[/events]" ... >

but instead it should be:

<a [routerLink]="['/events']" ... >

or

<a routerLink="/events" ... >
about 4 years ago · Santiago Trujillo Denunciar

0

The syntax error the symbol / is not a string. Add quotes around the string to resolve error. [] is for array declaration (on the value), if you use it then add string value otherwise you don't need an array just use the attribute value which is string by default in HTML. You also don't need routerLink binding with [] in the resent verisons released by Angular.

So, the code simplifies to

<a routerLink="/events">Events</a> 

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda