Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion for enhancement: Add mechanism to provide pixel configuration with useFactory() to pass pixelId or enabled states with environment #12

Open
Klypalskyi opened this issue Dec 17, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request needs research Further research is needed before implementing

Comments

@Klypalskyi
Copy link

Hi, I've tried several times in my local, to use your code after modifying it and providing InjectionToken instead of 'config'.
So, I've used next code:

import { PixelModule, PIXEL_CONFIG } from 'my-local-pixel';
@NgModule({
    imports: [PixelModule],
    providers: [
        { 
            provide: PIXEL_CONFIG,
            useFactory: (environmentService) => ({
               enabled: environmentService.config.PIXEL_ENABLED,
               pixelId: environmentService.config.PIXEL_ID,
            }),
            deps: [EnvironmentService]
        }
    ],
 
}

Unfortunately, it was causing some errors, that I haven't any possibility to debug. But with the current configuration Pixel is not working at all.
Do you have any advice or idea?

Can you being some update4 to your package, to use it with ENV?

@NielsCodes NielsCodes added enhancement New feature or request needs research Further research is needed before implementing labels Jan 1, 2022
@NielsCodes NielsCodes self-assigned this Jan 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs research Further research is needed before implementing
Projects
None yet
Development

No branches or pull requests

2 participants