Open naveedahmed1 opened 5 years ago
I think you could. Might need to make a provider for the injection token? https://github.com/scttcper/ng2-adsense/blob/master/src/lib/adsense.component.ts#L67
Can you please provide some more details about how to do this?
You could also use a shared module
import { NgModule } from '@angular/core';
import { AdsenseModule } from 'ng2-adsense';
@NgModule({
declarations: [
],
imports: [
AdsenseModule.forRoot({
adClient: 'yourNumberHere'
})
],
exports: [
AdsenseModule
]
})
export class SharedModule { }
The current docs states that we should add
AdsenseModule.forRoot
to theapp module
, as a result, this plugin becomes part of themain bundle
.What if we are using it in just 1-2 sections of the website and don't want it to be a part of
main bundle
. Currently we still have to add it toapp module
.It would be great to allow usage without adding it to app module and without
forRoot
.Can this use case be supported?