Socket
Socket
Sign inDemoInstall

angular-dadan-sdk

Package Overview
Dependencies
5
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    angular-dadan-sdk

A lightweight Angular package used for checking, validating, and manipulating [Google Dadan Extension](https://haal.link.sa/onboarding/download) with Angular.


Version published
Weekly downloads
4
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Angular Dadan SDK

A lightweight Angular package used for checking, validating, and manipulating Google Dadan Extension with Angular.

Install

npm install angular-dadan-sdk
Or
yarn add angular-dadan-sdk

Usage

In app.module.ts import the following

import { VideosModule } from 'angular-dadan-sdk';// our package
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    VideosModule //our module
  ],
  providers: [],
  bootstrap: [AppComponent]
});
export class AppModule { }

In app.component.html add the record button component with props

<lib-record-video-button
  (onSuccess)="handleResponse($event)"
  (onFailure)="handleResponse($event)"
  title="Select Video"
  type="select"
  buttonClass="dd__record__button__default__class"
  [buttonStyle]="{ color: '#1e3799', 'font-size': '15px' }"
  [showSvg]="true"
  [showPreview]="true"
  [copyToClipboard]="true"
>
</lib-record-video-button>

In app.component.ts add the following

export class AppComponent {
  title = 'angular-sample';
  public videos : any[]; // selected videos from extension
  constructor(){
    this.videos = []; // initial state
  }
  handleResponse($eventResult : any):void{ // handles selected or recorded videos
    const {success, data, message} = $eventResult;
    if (success) {
      if (data) {
        this.videos = data; //
        }
      } else {
        this.videos = [];//
        console.log(message);
      }
  }

}

the handleResponse function , is a callback function which accept object with three parameters

handleResponse($eventResult : any): void {
    const {success, data, message} = $eventResult;
    if (success) {
        // only false when user close extension
        if (data) {
            // represnts the selected videos , or recorded video object after stop recording
        this.videos = data;
            }
        } else {
        this.videos = [];
        console.error(message); //User Closed Extension
        }
    }

Record Button Props

ParameterTypeDescription
typestringRequired. either record or select , else will show error
titlestringOptional. button title
buttonClassstringOptional. the default class , or your custom class
buttonStyleobjectOptional. the default style , or your custom style as string
showSvgbooleanOptional. to show Svg icon in button
showPreviewbooleanOptional. to show preview dialog of recorded video
copyToClipboardbooleanOptional. to notify user that video shared url was copied to clipboard as toast message

License

MIT

FAQs

Last updated on 25 Oct 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc