adlerparnas / ngx-launchdarkly

Angular library for LaunchDarkly integration.
MIT License
3 stars 1 forks source link

flags is undefined (Angular 12) #19

Open nvahalik opened 2 years ago

nvahalik commented 2 years ago

I've tried integrating this project in an Angular 12 project and haven't been successful. I added it to my main AppComponent, and then to the individual components I need.

However, this is the message I am getting:

ERROR TypeError: flags is undefined
    _flagSubscription ngx-launchdarkly.js:168
    RxJS 3
    _setFlags ngx-launchdarkly.js:54
    LaunchDarklyService ngx-launchdarkly.js:35
nvahalik commented 2 years ago

Ah. Update. I believe I have found the issue.

There needs to be a check added to ensure that flags is not undefined. I had no flags returned back for this particular environment and so it was never updating.