• Version 15.0.1
  • Published
  • 123 kB
  • 2 dependencies
  • MIT license


npm i ngx-clipboard
yarn add ngx-clipboard
pnpm add ngx-clipboard


angular 2 clipboard



class ClipboardDirective

class ClipboardDirective implements OnInit, OnDestroy {}


    ngZone: any,
    host: any,
    renderer: any,
    clipboardSrv: ClipboardService

      property cbContent

      cbContent: string;

        property cbOnError

        cbOnError: any;

          property cbOnSuccess

          cbOnSuccess: any;

            property cbSuccessMsg

            cbSuccessMsg: string;

              property container

              container: HTMLElement;

                property ɵdir

                static ɵdir: any;

                  property ɵfac

                  static ɵfac: any;

                    property targetElm

                    targetElm: '' | HTMLInputElement | HTMLTextAreaElement;

                      method ngOnDestroy

                      ngOnDestroy: () => void;

                        method ngOnInit

                        ngOnInit: () => void;

                          class ClipboardIfSupportedDirective

                          class ClipboardIfSupportedDirective implements OnInit {}


                            _clipboardService: ClipboardService,
                            _viewContainerRef: any,
                            _templateRef: any

                              property ɵdir

                              static ɵdir: any;

                                property ɵfac

                                static ɵfac: any;

                                  method ngOnInit

                                  ngOnInit: () => void;

                                    class ClipboardModule

                                    class ClipboardModule {}

                                      property ɵfac

                                      static ɵfac: any;

                                        property ɵinj

                                        static ɵinj: any;

                                          property ɵmod

                                          static ɵmod: any;

                                            class ClipboardService

                                            class ClipboardService {}
                                            • The following code is heavily copied from


                                            constructor(ngZone: any, document: any, window: any);

                                              property copyResponse$

                                              copyResponse$: any;

                                                property document

                                                document: any;

                                                  property isSupported

                                                  readonly isSupported: boolean;

                                                    property ɵfac

                                                    static ɵfac: any;

                                                      property ɵprov

                                                      static ɵprov: any;

                                                        method configure

                                                        configure: (config: ClipboardParams) => void;

                                                          method copy

                                                          copy: (content: string) => void;

                                                            method copyFromContent

                                                            copyFromContent: (content: string, container?: HTMLElement) => boolean;
                                                            • Creates a fake textarea element, sets its value from text property, and makes a selection on it.

                                                            method copyFromInputElement

                                                            copyFromInputElement: (
                                                            targetElm: HTMLInputElement | HTMLTextAreaElement,
                                                            isFocus?: boolean
                                                            ) => boolean;
                                                            • Attempts to copy from an input targetElm

                                                            method destroy

                                                            destroy: (container?: HTMLElement) => void;
                                                            • Remove temporary textarea if any exists.

                                                            method isCopySuccessInIE11

                                                            isCopySuccessInIE11: () => boolean;
                                                            • This is a hack for IE11 to return true even if copy fails.

                                                            method isTargetValid

                                                            isTargetValid: (element: HTMLInputElement | HTMLTextAreaElement) => boolean;

                                                              method pushCopyReponse

                                                              pushCopyReponse: (response: IClipboardResponse) => void;
                                                              • Deprecated

                                                                use pushCopyResponse instead.

                                                              method pushCopyResponse

                                                              pushCopyResponse: (response: IClipboardResponse) => void;
                                                              • Pushes copy operation response to copySubject, to provide global access to the response.


                                                              interface ClipboardParams

                                                              interface ClipboardParams {}

                                                                property cleanUpAfterCopy

                                                                cleanUpAfterCopy?: boolean;

                                                                  interface IClipboardResponse

                                                                  interface IClipboardResponse {}

                                                                    property content

                                                                    content?: string;

                                                                      property event

                                                                      event?: Event;

                                                                        property isSuccess

                                                                        isSuccess: boolean;

                                                                          property successMessage

                                                                          successMessage?: string;

                                                                            Package Files (6)

                                                                            Dependencies (2)

                                                                            Dev Dependencies (0)

                                                                            No dev dependencies.

                                                                            Peer Dependencies (2)


                                                                            To add a badge like this badgeto your package's README, use the codes available below.

                                                                            You may also use to create a custom badge linking to

                                                                            • Markdown
                                                                            • HTML
                                                                              <a href=""><img src="" alt=""></a>