UNPKG

ngx-soundmanager2

Version:
65 lines 2.23 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ import { Directive, HostListener, Input } from '@angular/core'; import { MusicPlayerService } from './music-player.service'; var PlayAllDirective = /** @class */ (function () { function PlayAllDirective(_musicPlayerService) { this._musicPlayerService = _musicPlayerService; this.play = true; } /** * @return {?} */ PlayAllDirective.prototype.onClick = /** * @return {?} */ function () { var _this = this; this._musicPlayerService.clearPlaylist(function () { for (var /** @type {?} */ i = 0; i < _this.songs.length; i++) { _this._musicPlayerService.addTrack(_this.songs[i]); } if (_this.play) { // play first song // play first song _this._musicPlayerService.play(); } }); }; PlayAllDirective.decorators = [ { type: Directive, args: [{ selector: '[playAll]' },] } ]; /** @nocollapse */ PlayAllDirective.ctorParameters = function () { return [ { type: MusicPlayerService, }, ]; }; PlayAllDirective.propDecorators = { "songs": [{ type: Input },], "play": [{ type: Input },], "onClick": [{ type: HostListener, args: ['click', ['$event'],] },], }; return PlayAllDirective; }()); export { PlayAllDirective }; function PlayAllDirective_tsickle_Closure_declarations() { /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */ PlayAllDirective.decorators; /** * @nocollapse * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>} */ PlayAllDirective.ctorParameters; /** @type {!Object<string,!Array<{type: !Function, args: (undefined|!Array<?>)}>>} */ PlayAllDirective.propDecorators; /** @type {?} */ PlayAllDirective.prototype.songs; /** @type {?} */ PlayAllDirective.prototype.play; /** @type {?} */ PlayAllDirective.prototype._musicPlayerService; } //# sourceMappingURL=play-all.directive.js.map