Socket
Socket
Sign inDemoInstall

jsb-angular-flip-clock

Package Overview
Dependencies
5
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jsb-angular-flip-clock

A simple Clock Commponent to be used with Angular.


Version published
Weekly downloads
36
increased by80%
Maintainers
1
Install size
197 kB
Created
Weekly downloads
 

Readme

Source

JSBAngularFlipClock

  • A simple Number Counter Commponent to be used with Angular.
  • It is developed using Angular >=8.0.0 and its newly introduced ng g library schematics.
  • This library is part of JSBNumberCounter project and it is generated with Angular CLI version 8.3.21.
  • Library location: projects/jsb-angular-flip-clock directory of this repository.

Examples/Demo

  • A simple Example can be found under src/app directory of this repository.

Installation

npm i jsb-angular-flip-clock

Demo

App Demo

API

import { JSBAngularFlipClockModule } from 'jsb-angular-flip-clock'
selector: JSB-flipclock

@Inputs()

InputTypeRequiredDescription
HoursTensPlacenumberYESthe Number Data to be disaplayed.
HoursOnesPlacenumberYESthe Number Data to be disaplayed.
MinutesTensPlacenumberYESthe Number Data to be disaplayed.
MinutesOnesPlacenumberYESthe Number Data to be disaplayed.
SecondsTensPlacenumberYESthe Number Data to be disaplayed.
SecondsOnesPlacenumberYESthe Number Data to be disaplayed.

Usage

  1. Register the JSBNumCounterModule in your app module.

import { JSBAngularFlipClockModule } from 'jsb-angular-flip-clock'

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { JSBAngularFlipClockModule } from 'projects/jsb-angular-flip-clock/src/public-api';

@NgModule({
 declarations: [
   AppComponent
 ],
 imports: [
   BrowserModule,
   AppRoutingModule,
   JSBAngularFlipClockModule
 ],
 providers: [],
 bootstrap: [AppComponent]
})
export class AppModule { }
  1. Use the selector (JSBNumCounter) in your component.
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-root',
  template: `
  <JSB-flipclock 


[HoursTensPlace]='HoursTensPlace'
[HoursOnesPlace]='HoursOnesPlace'
[MinutesTensPlace]='MinutesTensPlace'
[MinutesOnesPlace]='MinutesOnesPlace'
[SecondsTensPlace]='SecondsTensPlace'
[SecondsOnesPlace]='SecondsOnesPlace'

></JSB-flipclock>`,
  styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
  title = 'angular-flip-clock';
  HoursTensPlace: number = 0;
  HoursOnesPlace: number = 0;
  MinutesTensPlace: number = 0;
  MinutesOnesPlace: number = 0;
  SecondsTensPlace: number = 0;
  SecondsOnesPlace: number = 0;
  ngOnInit() {

    setInterval
      (_ => {
        this.HoursTensPlace=Math.floor(Math.random() * 9) + 1;
        this.HoursOnesPlace=Math.floor(Math.random() * 9) + 1;
        this.MinutesTensPlace=Math.floor(Math.random() * 9) + 1;
        this.MinutesOnesPlace=Math.floor(Math.random() * 9) + 1;
        this.SecondsTensPlace=Math.floor(Math.random() * 9) + 1;
        this.SecondsOnesPlace=Math.floor(Math.random() * 9) + 1;

      }, 1000);

  }
}

Screenshot

Keywords

FAQs

Last updated on 02 Jan 2020

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