How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • /* avoid */
    
    @Component({
      selector: 'toh-hero-button',
      template: `<button></button>`,
      inputs: [
        'label'
      ],
      outputs: [
        'heroChange'
      ]
    })
    export class HeroButtonComponent {
      heroChange = new EventEmitter<any>();
      label: string;
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • export class HeroComponent {
      @Output() savedTheDay = new EventEmitter<boolean>();
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">class</span> <span class="token class-name">HeroComponent</span></code></pre>
    Docs
    0
  • /* avoid */
    
    @Component({
      selector: 'toh-hero',
      template: `...`
    })
    export class HeroComponent {
      @Output() onSavedTheDay = new EventEmitter<boolean>();
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • @Component({
      selector: 'app-zippy',
      template: `
        <div class="zippy">
          <div (click)="toggle()">Toggle</div>
          <div [hidden]="!visible">
            <ng-content></ng-content>
          </div>
        </div>
      `,
    })
    export class ZippyComponent {
      visible = true;
      @Output() open = new EventEmitter<any>();
      @Output() close = new EventEmitter<any>();
    
      toggle() {
        this.visible = !this.visible;
        if (this.visible) {
          this.open.emit(null);
        } else {
          this.close.emit(null);
        }
      }
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • export class ProductAlertsComponent {
      @Input() product: Product | undefined;
      @Output() notify = new EventEmitter();
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">class</span> <span class="token class-name">ProductAlertsComponent</span></code></pre>
    Docs
    0
  • import { Directive, HostBinding, HostListener } from '@angular/core';
    
    @Directive({
      selector: '[tohValidator]'
    })
    export class ValidatorDirective {
      @HostBinding('attr.role') role = 'button';
      @HostListener('mouseenter') onMouseEnter() {
        // do work
      }
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">interface</span> <span class="token class-name">Directive</span> <span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> Directive<span class="token operator">:</span> DirectiveDecorator <span class="token keyword">import</span> Directive</code><div class="typing-tooltip-markup">Directive decorator and metadata. Type of the Directive metadata.<br><br><em>@Annotation</em><br><br><em>@publicApi</em><br><br><em>@publicApi</em></div></pre>
    Docs
    0
  • @Input() items: Item[] = [];
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • @Directive({
      selector: '[appForbiddenName]',
      providers: [{provide: NG_VALIDATORS, useExisting: ForbiddenValidatorDirective, multi: true}]
    })
    export class ForbiddenValidatorDirective implements Validator {
      @Input('appForbiddenName') forbiddenName = '';
    
      validate(control: AbstractControl): ValidationErrors | null {
        return this.forbiddenName ? forbiddenNameValidator(new RegExp(this.forbiddenName, 'i'))(control)
                                  : null;
      }
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • @Input() childItem = '';
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • export class ProductAlertsComponent implements OnInit {
    
      @Input() product!: Product;
      constructor() { }
    
      ngOnInit() {
      }
    
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">class</span> <span class="token class-name">ProductAlertsComponent</span></code></pre>
    Docs
    0
  • const template = '<div>{{hero.name}}</div>';
    
    @Component({
      selector: 'app-hero',
      template: template + '<div>{{hero.title}}</div>'
    })
    export class HeroComponent {
      @Input() hero: Hero;
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">const</span> template<span class="token operator">:</span> <span class="token string">"&lt;div>{{hero.name}}&lt;/div>"</span></code></pre>
    Docs
    0
  • var MockSocket = function(){
    	this._frames = []; 
    	this._closed = false;
    	this._emitter = new EventEmitter();
    };
    
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">class</span> <span class="token class-name">MockSocket</span> <span class="token keyword">var</span> MockSocket<span class="token operator">:</span> <span class="token keyword">typeof</span> MockSocket</code></pre>
    /azuqua/node-token-sockjs MIT
    0
  • constructor (options) {
        this.config = config.fromOptions(options || {});
        this.events = new EventEmitter();
        this.nested = [];
        this.debugObject = {};
        this.tmpDir = this._makeTmpDir();
      }
    
      
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript">constructor <span class="token function">Applesign</span><span class="token punctuation">(</span>options<span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">)</span><span class="token operator">:</span> Applesign</code></pre>
    /nowsecure/node-applesign mit
    0
  • constructor(options) {
            
            //...
    this.logger = _.get(options, 'logger', logger);
            this.requestTimeout = options.requestTimeout || 6000;
            this.protocol = 'janus-protocol';
            this.webSocket = null;
            this.WebSocket = _.get(options, 'WebSocket', WebSocket);
            this.emitter = new EventEmitter();
            this.transactions = {};
            this.connectionTimeoutTimer = null;
            this.connectionTimeout = options.connectionTimeout || 40000;
            this.lastConnectionEvent = ClientEvent.disconnected;
            this.sessions = {};
            this.hasInfo = false;
            
            //...
    }
    
        
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript">constructor <span class="token function">Client</span><span class="token punctuation">(</span>options<span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">)</span><span class="token operator">:</span> Client</code><div class="typing-tooltip-markup"><em>@class</em></div></pre>
    /sipwise/janus-client gpl-3.0
    0
  • const eventEmitter = new events.EventEmitter();
    
    
    
    
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">const</span> eventEmitter<span class="token operator">:</span> events</code></pre>
    /arvind-balaji/debate-cards MIT
    0
  • //...
    var emitter = new events.EventEmitter();
    
    
    
    //...
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">var</span> emitter<span class="token operator">:</span> events</code></pre>
    /jadonk/bonescript MIT
    0
  • function emitUnavailable() {
        var emitter = new EventEmitter();
        setImmediate(function () {
            emitter.emit('error', new Error('no active connections'));
        });
        return (emitter);
    }
    
    
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token function">emitUnavailable</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">:</span> EventEmitter</code></pre>
    /joyent/node-moray MPL-2.0
    0
  • module.exports.rawErrorEmitter = (from) => {
        const emitter = new EventEmitter();
        
        process.nextTick(() => {
            emitter.emit('error', Error(`EACCES: ${from}`));
        });
        
        return emitter;
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">var</span> module<span class="token operator">:</span> <span class="token punctuation">{</span> exports<span class="token operator">:</span> <span class="token keyword">typeof</span> module<span class="token punctuation">.</span>exports<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre>
    /cloudcmd/node-fileop mit
    0
  • const onError = (e) => {
            const error = Error(`Error reading package.json: ${e.message}`);
            emitter.emit('error', error);
        };
        
        
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">const</span> <span class="token function-variable function">onError</span><span class="token operator">:</span> <span class="token punctuation">(</span><span class="token parameter">e<span class="token operator">:</span> any</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token keyword">void</span></code></pre>
    /coderaiser/wisdom mit
    0
  • const { EventEmitter, errorMonitor } = require('events');
    
    const myEmitter = new EventEmitter();
    myEmitter.on(errorMonitor, (err) => {
      MyMonitoringTool.log(err);
    });
    myEmitter.emit('error', new Error('whoops!'));
    // Still throws and crashes Node.js
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">class</span> <span class="token class-name">EventEmitter</span> <span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">namespace</span> EventEmitter <span class="token keyword">import</span> EventEmitter</code><div class="typing-tooltip-markup">The <code>EventEmitter</code> class is defined and exposed by the <code>events</code> module:<br><br><pre class="code js"><code class="language-js">const EventEmitter = require('events');</code></pre><br><br>All <code>EventEmitter</code>s emit the event <code>'newListener'</code> when new listeners are added and <code>'removeListener'</code> when existing listeners are removed.<br><br>It supports the following option:<br><br><em>@since</em> — v0.1.26</div></pre>
    Docs
    0
  • const { EventEmitter, once } = require('events');
    
    const myEE = new EventEmitter();
    
    async function foo() {
      await Promise.all([once(myEE, 'bar'), once(myEE, 'foo')]);
      console.log('foo', 'bar');
    }
    
    process.nextTick(() => {
      myEE.emit('bar');
      myEE.emit('foo');
    });
    
    foo().then(() => console.log('done'));
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">class</span> <span class="token class-name">EventEmitter</span> <span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">namespace</span> EventEmitter <span class="token keyword">import</span> EventEmitter</code><div class="typing-tooltip-markup">The <code>EventEmitter</code> class is defined and exposed by the <code>events</code> module:<br><br><pre class="code js"><code class="language-js">const EventEmitter = require('events');</code></pre><br><br>All <code>EventEmitter</code>s emit the event <code>'newListener'</code> when new listeners are added and <code>'removeListener'</code> when existing listeners are removed.<br><br>It supports the following option:<br><br><em>@since</em> — v0.1.26</div></pre>
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples