scttcper / ng2-adsense

Angular Adsense Component
https://ng2-adsense.xmplaylist.com
MIT License
138 stars 24 forks source link

Angular 7 support for multiple components #359

Closed chrisrodriguezkinesso closed 5 years ago

chrisrodriguezkinesso commented 5 years ago

I followed your directions and put it in module.ts all necessary info to start.

I get errors by placing in different components. <ng-adsense [width]="300" [height]="300" [className]="horizontal-square"> </ng-adsense>

scttcper commented 5 years ago

What kind of errors

chrisrodriguezkinesso commented 5 years ago

@scttcper well if you add a component outside root module, like a page, what is the import for that page module? Because the error is ng-adsense is not recognized as a supported component.

chrisrodriguezkinesso commented 5 years ago

@scttcper I have to put this in every component?

AdsenseModule.forRoot({
  adClient: 'ca-pub-7640562161899788',
  adSlot: 7259870550,
})
scttcper commented 5 years ago

No you would put that at the root module and that’s it

chrisrodriguezkinesso commented 5 years ago

Well I have to put it in multiple modules with different components.

chrisrodriguezkinesso commented 5 years ago

@scttcper I am getting 400 errors on my angular site. I am already approved and stuff anyway you can help me and check it out? Getting this error.

The resource https://pagead2.googlesyndication.com/pagead/js/r20190903/r20190131/show_ads_impl.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.
ads:1 Failed to load resource: the server responded with a status of 400 ()