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

  • import { NgModule } from '@angular/core';
    import { BrowserModule } from '@angular/platform-browser';
    
    import { AppComponent } from './app.component';
    import { HeroesComponent } from './heroes/heroes.component';
    
    @NgModule({
      imports: [
        BrowserModule,
      ],
      declarations: [
        AppComponent,
        HeroesComponent
      ],
      exports: [ AppComponent ],
      entryComponents: [ AppComponent ]
    })
    export class AppModule {}
    <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">NgModule</span> <span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> NgModule<span class="token operator">:</span> NgModuleDecorator <span class="token keyword">import</span> NgModule</code><div class="typing-tooltip-markup">Type of the NgModule metadata.<br><br><em>@publicApi</em><br><br><em>@Annotation</em><br><br><em>@publicApi</em></div></pre>
    Docs
    0
  • import { NgModule } from '@angular/core';
    import { BrowserModule } from '@angular/platform-browser';
    
    import { AppComponent } from './app.component';
    
    @NgModule({
      imports: [ BrowserModule ],
      declarations: [ AppComponent ],
      bootstrap: [ AppComponent ]
    })
    export class AppModule { }
    <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">NgModule</span> <span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> NgModule<span class="token operator">:</span> NgModuleDecorator <span class="token keyword">import</span> NgModule</code><div class="typing-tooltip-markup">Type of the NgModule metadata.<br><br><em>@publicApi</em><br><br><em>@Annotation</em><br><br><em>@publicApi</em></div></pre>
    Docs
    0
  • import { NgModule } from '@angular/core';
    import { CommonModule } from '@angular/common';
    import { CustomersRoutingModule } from './customers-routing.module';
    import { CustomersComponent } from './customers.component';
    
    @NgModule({
      imports: [
        CommonModule,
        CustomersRoutingModule
      ],
      declarations: [CustomersComponent]
    })
    export class CustomersModule { }
    <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">NgModule</span> <span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> NgModule<span class="token operator">:</span> NgModuleDecorator <span class="token keyword">import</span> NgModule</code><div class="typing-tooltip-markup">Type of the NgModule metadata.<br><br><em>@publicApi</em><br><br><em>@Annotation</em><br><br><em>@publicApi</em></div></pre>
    Docs
    0
  • import { HttpClientModule } from '@angular/common/http';
    import { NgModule } from '@angular/core';
    import { FormsModule } from '@angular/forms';
    import { BrowserModule } from '@angular/platform-browser';
    
    import { AppComponent } from './app.component';
    // import the feature module here so you can add it to the imports array below
    import { CustomerDashboardModule } from './customer-dashboard/customer-dashboard.module';
    
    @NgModule({
      declarations: [
        AppComponent
      ],
      imports: [
        BrowserModule,
        FormsModule,
        HttpClientModule,
        CustomerDashboardModule // add the feature module here
      ],
      providers: [],
      bootstrap: [AppComponent]
    })
    export class AppModule { }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> HttpClientModule</code></pre>
    Docs
    0
  • import { NgModule }      from '@angular/core';
    import { BrowserModule } from '@angular/platform-browser';
    import { FormsModule }   from '@angular/forms';
    
    import { AppComponent }  from './app.component';
    
    // #docregion class
    @NgModule({
      imports:      [ BrowserModule, FormsModule ],
      declarations: [ AppComponent ],
      bootstrap:    [ AppComponent ]
    })
    export class AppModule { }
    // #enddocregion class
    <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">NgModule</span> <span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> NgModule<span class="token operator">:</span> NgModuleDecorator <span class="token keyword">import</span> NgModule</code><div class="typing-tooltip-markup">Type of the NgModule metadata.<br><br><em>@publicApi</em><br><br><em>@Annotation</em><br><br><em>@publicApi</em></div></pre>
    Docs
    0
  • //...
    import component from './dedicatedCloud-datacenter-host-orderLegacy.component';
    
    const moduleName = 'ovhManagerDedicatedCloudDatacenterHostOrderLegacyComponent';
    
    angular
      .module(moduleName, [
        'ngTranslateAsyncLoader',
        'oui',
        'pascalprecht.translate',
      ])
      .component('ovhManagerDedicatedCloudDatacenterHostOrderLegacy', component)
      .run(/* @ngTranslationsInject:json ./translations */);
    
    export default moduleName;
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> component</code></pre>
    /ovh/manager BSD-3-Clause
    0
  • //...
    import component from './component';
    import './index.scss';
    
    const moduleName = 'ovhManagerWebPaasAdditionalOption';
    
    angular
      .module(moduleName, [
        'ngTranslateAsyncLoader',
        'oui',
        'pascalprecht.translate',
      ])
      .component('webPaasAdditionalOption', component)
      .run(/* @ngTranslationsInject:json ./translations */);
    
    export default moduleName;
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> component</code></pre>
    /ovh/manager BSD-3-Clause
    0
  • //...
    import component from './dedicatedCloud-security-kms-edit.component';
    
    const moduleName = 'ovhManagerPccSecurityKmsEdit';
    
    angular
      .module(moduleName, [
        'ngTranslateAsyncLoader',
        'oui',
        'pascalprecht.translate',
      ])
      .component(component.name, component)
      .run(/* @ngTranslationsInject:json ./translations */);
    
    export default moduleName;
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> component</code></pre>
    /ovh/manager BSD-3-Clause
    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
  • @Input() items: Item[] = [];
    <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
  • @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
  • import { Component, Input } from '@angular/core';
    
    /**
     * Example progressbar component.
     */
    @Component({
      selector: 'app-example-progressbar',
      template: `<div class="bar" [style.width.%]="value"></div>`,
      styleUrls: ['./progress-bar.component.css'],
      host: {
        // Sets the role for this component to "progressbar"
        role: 'progressbar',
    
        // Sets the minimum and maximum values for the progressbar role.
        'aria-valuemin': '0',
        'aria-valuemax': '100',
    
        // Binding that updates the current value of the progressbar.
        '[attr.aria-valuenow]': 'value',
      }
    })
    export class ExampleProgressbarComponent  {
      /** Current value of the progressbar. */
      @Input() value = 0;
    }
    <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">Component</span> <span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> Component<span class="token operator">:</span> ComponentDecorator <span class="token keyword">import</span> Component</code><div class="typing-tooltip-markup">Supplies configuration metadata for an Angular component. Component decorator and metadata.<br><br><em>@publicApi</em><br><br><em>@Annotation</em><br><br><em>@publicApi</em></div></pre>
    Docs
    0
  • import { Attribute, Component } from '@angular/core';
    
    @Component({
      selector: 'app-my-input-with-attribute-decorator',
      template: '<p>The type of the input is: {{ type }}</p>'
    })
    export class MyInputWithAttributeDecoratorComponent {
      constructor(@Attribute('type') public type: string) { }
    }
    <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">Attribute</span> <span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> Attribute<span class="token operator">:</span> AttributeDecorator <span class="token keyword">import</span> Attribute</code><div class="typing-tooltip-markup">Type of the Attribute metadata. Attribute decorator and metadata.<br><br><em>@publicApi</em><br><br><em>@Annotation</em><br><br><em>@publicApi</em></div></pre>
    Docs
    1
  • @Component({
      selector: 'toh-hero-button',
      templateUrl: './hero-button.component.html'
    })
    export class HeroButtonComponent {}
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • /* avoid */
    
    @Component({
      selector: 'tohHeroButton',
      templateUrl: './hero-button.component.html'
    })
    export class HeroButtonComponent {}
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • @Component({
      selector: 'app-emulated-encapsulation',
      template: `
        <h2>Emulated</h2>
        <div class="emulated-message">Emulated encapsulation</div>
        <app-no-encapsulation></app-no-encapsulation>
      `,
      styles: ['h2, .emulated-message { color: green; }'],
      encapsulation: ViewEncapsulation.Emulated,
    })
    export class EmulatedEncapsulationComponent { }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • import { Router, NavigationStart } from '@angular/router';
    import { filter } from 'rxjs/operators';
    
    @Component({
      selector: 'app-routable',
      template: 'Routable1Component template'
    })
    export class Routable1Component implements OnInit {
    
      navStart: Observable<NavigationStart>;
    
      constructor(router: Router) {
        // Create a new Observable that publishes only the NavigationStart event
        this.navStart = router.events.pipe(
          filter(evt => evt instanceof NavigationStart)
        ) as Observable<NavigationStart>;
      }
    
      ngOnInit() {
        this.navStart.subscribe(() => console.log('Navigation Started!'));
      }
    }
    <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">Router</span> <span class="token keyword">import</span> Router</code><div class="typing-tooltip-markup"><em>@description</em> — A service that provides navigation among views and URL manipulation capabilities.<br><br><em>@see</em> — <code>Route</code>.<br><br><em>@see</em> — <a href="guide/router">Routing and Navigation Guide</a>.<br><br><em>@ngModule</em> — RouterModule<br><br><em>@publicApi</em></div></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
  • 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
  • @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
  • /* 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
  • export class SizerComponent {
    
      @Input()  size!: number | string;
      @Output() sizeChange = new EventEmitter<number>();
    
      dec() { this.resize(-1); }
      inc() { this.resize(+1); }
    
      resize(delta: number) {
        this.size = Math.min(40, Math.max(8, +this.size + delta));
        this.sizeChange.emit(this.size);
      }
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">class</span> <span class="token class-name">SizerComponent</span></code></pre>
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples