🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@welight/ngx-components

Package Overview
Dependencies
Maintainers
5
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@welight/ngx-components

> Components for Angular to use in Welight projects.

latest
npmnpm
Version
0.3.2
Version published
Maintainers
5
Created
Source

Welight Components

Components for Angular to use in Welight projects.

npm (scoped)

Installation

Step 1

npm install @welight/ngx-components

Step 2

Configure AppModule to use Welight components.

import { WelightComponentsModule } from '@welight/ngx-components';

@NgModule({
  imports: [
    // others modules...
    WelightComponentsModule
  ]
})
export class AppModule {}

Components

WelightCardOng <welight-card-ong>

Inputs

NameTypeDescription
showTitlebooleanDisplay name of Ong.
showDescriptionbooleanDisplay description of Ong.
isCheckablebooleanDisplay checkbox into card
checkedbooleanCheckbox initial value.
showButtonsbooleanDisplay footer buttons into card.
ongObject<Ong>An object of type Ong with data.

Outputs

NameTypeDescription
checkboxChangeEventEmitter<WelightCardOngChange>When checkbox clicked

Example

Demo

Note: To make the best use of the library, install in you project @welight/welight-api-ts.

HTML Template
<welight-card-ong
  *ngIf="ong"
  [ong]="ong"
  [isCheckable]="true"
  [checked]="true"
  [showDescription]="false"
  (checkboxChange)="changeOng($event)"
></welight-card-ong>
Typescript File
import { WelightCardOngChange } from '@welight/ngx-components';

@Component({
  selector: 'example'
})
export class ExampleComponent {
  ong: Ong;

  constructor(private service: WelightService){}

  async ngOnInit() {
    this.ong = await this.service.ongs.objects.find()[0];
  }

  changeOng(event: WelightCardOngChange) {
    console.log(event);
  }
}

WelightShimmerPlaceholder <welight-shimmer-placeholder>

Inputs

NameTypeDescription
dataPromise | string | string[]Array of URLs or Promise to resolve.
forceResultbooleanForce display result when exists error.

Outputs

NameTypeDescription
onCompleteEventEmitter<any>When finish load.
onSuccessEventEmitter<any>When finish load with success.
onErrorEventEmitter<any>When finish load with error.

Example

Demo

HTML Template
<welight-shimmer-placeholder [data]="data">
  <welight-placeholder-container>
    <p wePlaceholderItem height="20px"></p>
  </welight-placeholder-container>

  <welight-shimmer-result>
    <p>Lorem Ipsum...<p>
  </welight-shimmer-result>
</welight-shimmer-placeholder>
Typescript File
@Component({
  selector: 'example'
})
export class ExampleComponent {
  data: Promise<any>;

  ngOnInit() {
    this.ong = new Promise((resolve, reject) => {
      setTimeout(() => {
        resolve();
      }, 5000);
    });
  }
}

FAQs

Package last updated on 23 May 2019

Did you know?

Socket

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