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

前端 未结 7 1251
逝去的感伤
逝去的感伤 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:

    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.

提交回复
热议问题