Property 'X' is private and only accessible within class 'xyzComponent'

前端 未结 7 1217
逝去的感伤
逝去的感伤 2020-12-07 13:48

I\'m trying to build angular2 application for production for that I\'m following this blog. After my ngc successful compilation when the

相关标签:
7条回答
  • 2020-12-07 14:25

    If you want to use router in view, please make it public.

    E.g:

    <button 
       [routerLink]="['/login']"
       [queryParams]="{redirectTo: router.url}"
       translate="Please sign in to use this feature"
    />
    
    import { Router } from '@angular/router'; 
    
    constructor(
       public router: Router; // don't make it private
    ) {}
    

    I overlooked it until Github CI sends me a warning mail.

    0 讨论(0)
提交回复
热议问题