ngx-scrollreveal icon indicating copy to clipboard operation
ngx-scrollreveal copied to clipboard

Remove unclear comment regarding unnecessary provider

Open huckpilot opened this issue 8 years ago • 3 comments

Comment leads user to believe that adding NgsRevealConfig as a provider was necessary.

huckpilot avatar Mar 30 '17 21:03 huckpilot

Coverage Status

Coverage remained the same at 95.918% when pulling 74ce11d0bb565751a2a5922222126532b5e41226 on huckpilot:patch-1 into e366587774b313a13ac6ab1f19ea9c33ae6ba475 on tinesoft:master.

coveralls avatar Mar 30 '17 21:03 coveralls

Hi @huckpilot ,

Adding NgsRevealConfig to providers list of the component IS necessary when you want to customize the settings for that component and its children. Of course, if you don't need any global customization, there is no need. That why this part is in a different section of the README.

What do you find misleading or unclear in the docs?

tinesoft avatar Mar 31 '17 09:03 tinesoft

@tinesoft Thanks for the reply!

This may be an issue on my part.

my app.compoment.ts file:

import { NgsRevealConfig } from 'ng-scrollreveal';
...
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss'],
  providers: [ContentfulService, NgsRevealConfig],
...
  constructor(
    private config: NgsRevealConfig
...
    config.scale = 1;
    config.opacity = 0;
    config.reset = true;

When I add NgsRevealConfig to my component provider, the global config values are not recognized site wide. However when I remove NgsRevealConfig from my component provider, the scroll reveal global config values are functioning.

huckpilot avatar Mar 31 '17 18:03 huckpilot