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

Adding multiple CustomButtons adds only the last CustomButton #222

Closed
fiedler-s opened this issue Feb 27, 2018 · 0 comments
Closed

Adding multiple CustomButtons adds only the last CustomButton #222

fiedler-s opened this issue Feb 27, 2018 · 0 comments
Labels
Milestone

Comments

@fiedler-s
Copy link

Bug Report or Feature Request (mark with an x)

- [ x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] question

OS and Version?

All

Versions

Angular CLI: 1.7.0
Node: 9.1.0
OS: darwin x64
Angular: 5.2.1
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router

@angular/cdk: 2.0.0-beta.12
@angular/cli: 1.7.0
@angular/material: 2.0.0-beta.12
@angular/service-worker: 5.1.3
@angular-devkit/build-optimizer: 0.3.1
@angular-devkit/core: 0.3.1
@angular-devkit/schematics: 0.3.1
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.0
@schematics/angular: 0.3.1
@schematics/package-update: 0.3.1
typescript: 2.5.3
webpack-bundle-analyzer: 2.9.2
webpack-node-externals: 1.6.0
webpack: 3.11.0

Repro steps

constructor(private share: ShareButtons) {

    this.share.registerButton('xing', {
        type: 'xing',
        text: 'Xing',
        icon: 'fa fa-xing',
        share: {
            desktop: 'sharerURLForXing',  // the sharer link used to share on xing
            android: 'sharerURLForXing',  // the sharer link used to share on xing
            ios: 'sharerURLForXing',      // the sharer link used to share on xing
            operators: [noneOperator]
        }
    });

    this.share.registerButton('messenger', {
        type: 'messenger',
        text: 'Messenger',
        icon: 'fa fa-messenger',
        share: {
            desktop: 'sharerURLForMessenger',  // the sharer link used to share on Messenger
            android: 'sharerURLForMessenger',  // the sharer link used to share on Messenger
            ios: 'sharerURLForMessenger',      // the sharer link used to share on Messenger
            operators: [noneOperator]
        }
    });
}

The log given by the failure

Desired functionality

When adding multiple CustomButtons all will be added, not only the last one.

Mention any other details that might be useful

Error is in Method registerButton, it adds the CustomButton to the default ShareButtons and makes them the current ShareButtons.
Instead of adding the CustomButton to the default ShareButtons it should be added to the current set of ShareButtons, this way all the added CustomButtons will be present.

@fiedler-s fiedler-s changed the title Adding multiple CustomButtons add only the last CustomButton Adding multiple CustomButtons adds only the last CustomButton Feb 27, 2018
@MurhafSousli MurhafSousli added this to the 5.1.0 milestone Mar 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants