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

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

    I got this when I declared private injectables in the constructor:

    constructor(private service: SpecificObjectService) { }
    

    And used them in the template:

    *ngFor="let pd of service.listSpecificObject "
    

    The solution is:

    constructor(public service: SpecificObjectService) { }
    

提交回复
热议问题