#Service before constructor

11 messages · Page 1 of 1 (latest)

hasty thistle
#

Hello, we are updating ou app from angular 13 to 14. previously we were using our services before the constructor dependency injection and it was working. After updating it is no longer working.

  1. what changed from 13-14 that stopped this I cant find any resource online

  2. linting doesnt show an error for that how could we add an error for that so we can know what to fix

crystal furnace
#

Better if you post the code and the error you get.

hasty thistle
#

we have the following defined before the constructor:

page = this.filterSerivce.getCachedFilterPage(this.vulnerabilityType)

then we define
constructor(filterService: FilterService){}

then here is the error
Cannot read properties of undefined (reading 'getCachedFilterPager') at >instance_member_initializer? (qualys-vulnerability-list.component.ts)

primal tapir
#

constructor(private filterService: FilterService){}

#

without private/public, its not accessible outside the ctor.

hasty thistle
#

thats already like that, I made an error transcribing the code

#

so it is not the issue sorry 😅

crystal furnace
#

Copy paste the real code of the interesting part.

hasty thistle
#

The issue is with node, we had to update it to fix it

#

apprently a conflict happens with a certain node version with angular 14

#

We updated and it works