Skip to content

Commit eda87d6

Browse files
add typedocs and make feature disabled as default
1 parent c346b53 commit eda87d6

3 files changed

Lines changed: 32 additions & 2 deletions

File tree

src/app/social/social.service.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ import {
2020

2121
import { environment } from '../../environments/environment';
2222

23+
/**
24+
* Singleton service responsible for integration with AddToAny plugin to initialize 3rd party script and hold state
25+
* Bootstrap with Angular start in {@link AppComponent} which initializess route subscription
26+
* Bootstrap of integration starts at clientside with {@link SocialComponent} which loads 3rd party script
27+
*/
2328
@Injectable( { providedIn: 'root' } )
2429
export class SocialService {
2530
private showOnCurrentRouteSubject = new BehaviorSubject(false);
Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
11
import { Config } from './config.interface';
22

3-
3+
/**
4+
* Configuration interface for AddToAny plugin to display social links
5+
*/
46
export interface AddToAnyPluginConfig extends Config {
7+
/**
8+
* Script URL to AddToAny plugin, defaults to AddToAny CDN
9+
*/
510
scriptUrl: string;
11+
/**
12+
* Enable feature flag
13+
*/
614
socialNetworksEnabled: boolean;
15+
/**
16+
* Mandatory parameter for AddToAny(data-a2a-title). It will be included as part of social link share
17+
*/
718
title: string;
19+
/**
20+
* Listed elements will be rendered with their respective icon
21+
* List of the integrations, you can check these at https://www.addtoany.com/buttons/for/website
22+
*/
823
buttons: string[];
24+
/**
25+
* Shows plus button which allows to share with different integrations which were not listed in buttons
26+
*/
927
showPlusButton: boolean;
28+
/**
29+
* Shows counter for the integration https://www.addtoany.com/buttons/customize/share_counters where it is allowed
30+
*/
1031
showCounters: boolean;
1132
}

src/config/default-app-config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,9 +783,13 @@ export class DefaultAppConfig implements AppConfig {
783783
],
784784
};
785785

786+
/**
787+
* Default configuration of AddToAny plugin for social media integration
788+
* Check more details at {@link AddToAnyPluginConfig}
789+
*/
786790
addToAnyPlugin: AddToAnyPluginConfig = {
787791
scriptUrl: 'https://static.addtoany.com/menu/page.js',
788-
socialNetworksEnabled: true,
792+
socialNetworksEnabled: false,
789793
buttons: ['facebook', 'x', 'linkedin', 'email', 'copy_link'],
790794
showPlusButton: true,
791795
showCounters: true,

0 commit comments

Comments
 (0)