components/flashbox/flashbox.component.js
/**
     * Use this method to start flashbox flashing for predefined number of times.
     */
Use this method to start flashbox flashing for predefined number of times.
Use this method to start flashbox flashing for predefined number of times .
flashTimes(times) {
        if (times < 0) {
            console.error("Value must be greater than 0");
            this._invalidValue.emit();
            return;
        }
        if ((this._intervalCounterObserver != null && !this._intervalCounterObserver.closed) || this.isShown) {
            console.error("FlashBox component is either shown or flashing");
            this._busy.emit();
            return;
        }
        this._intervalCounterHandler = Rx_1.Observable.timer(0, this._setTimeout + 1000);
        this._intervalCounterObserver = this._intervalCounterHandler.subscribe((num) => {
            if (num != times * 2) {
                this.toggle();
            }
            else {
                this._intervalCounterObserver.unsubscribe();
            }
        });
    }
flashTimes ( times ) { if ( times < 0 ) { console . error ( "Value must be greater than 0" ) ; this . _invalidValue . emit ( ) ; return ; } if ( ( this . _intervalCounterObserver != null && ! this . _intervalCounterObserver . closed ) || this . isShown ) { console . error ( "FlashBox component is either shown or flashing" ) ; this . _busy . emit ( ) ; return ; } this . _intervalCounterHandler = Rx_1 . Observable . timer ( 0 , this . _setTimeout + 1000 ) ; this . _intervalCounterObserver = this . _intervalCounterHandler . subscribe ( ( num ) => { if ( num != times * 2 ) { this . toggle ( ) ; } else { this . _intervalCounterObserver . unsubscribe ( ) ; } } ) ; }
Use this method to start flashbox flashing for predefined number of times.
Use this method to start flashbox flashing for predefined number of times .
//invalid value //if already blinking or shown do nothing //message must be hidden to start flashing //this._intervalCounterHandler=Observable.timer(0, parseInt(this._setTimeout)+1000); // console.log(num);