Problem with routerLink in angle 6

1

I'm having the following error:

Can't bind to 'routerLink' since it isn't a known property of 'a'. ("
          <h6 class="text-center">
            Do not have an account yet?
            <a [ERROR ->][routerLink]="['/signup']">Sign up now!</a>
          </h6>
        </div>

I did some research but found nothing that I could solve.

I have already imported RouterModule and Routes into my app-routing.module.ts : import { RouterModule, Routes } from '@angular/router';

And this file, I'm importing into my app.module.ts .

This is working fine, and the router is generating the error when I use the RouterLink propertyBinding.

    
asked by anonymous 26.09.2018 / 00:50

1 answer

1

Imports the RouterModule into the module that you declare your component and not just the app module.

    
26.09.2018 / 09:52