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 { Directive } from '@angular/core';
    
    @Directive({
      selector: '[tohValidator2]',
      host: {
        '[attr.role]': 'role',
        '(mouseenter)': 'onMouseEnter()'
      }
    })
    export class Validator2Directive {
      role = 'button';
      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
    1
  • import { Directive } from '@angular/core';
    
    @Directive({
      selector: '[appItem]'
    })
    export class ItemDirective {
    // code goes here
      constructor() { }
    
    }
    <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
  • @Directive({
      selector: '[tohHighlight]'
    })
    export class HighlightDirective {
      @HostListener('mouseover') onMouseEnter() {
        // do highlight work
      }
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • /* avoid */
    
    @Directive({
      selector: '[validate]'
    })
    export class ValidateDirective {}
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • @Directive({
      selector: '[tohValidate]'
    })
    export class ValidateDirective {}
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • //...
    function gmfLayertreeComponent(ngeoLayertreeTemplateUrl) {
      return {
        restrict: 'A',
        scope: true,
        templateUrl: ngeoLayertreeTemplateUrl,
        controller: LayertreeController,
      };
    }
    
    myModule.directive('ngeoLayertree', gmfLayertreeComponent);
    
    export default myModule;
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token function">gmfLayertreeComponent</span><span class="token punctuation">(</span>ngeoLayertreeTemplateUrl<span class="token operator">:</span> <span class="token builtin">string</span> <span class="token operator">|</span> <span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">arg0<span class="token operator">:</span> JQuery <span class="token operator">|</span> <span class="token keyword">undefined</span><span class="token punctuation">,</span> arg1<span class="token operator">:</span> angular<span class="token punctuation">.</span>IAttributes <span class="token operator">|</span> <span class="token keyword">undefined</span></span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token builtin">string</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token operator">:</span> angular<span class="token punctuation">.</span>IDirective</code><div class="typing-tooltip-markup">Provides the "ngeoLayertree" directive, a directive for creating layer trees in application.<br><br>The directive assumes that tree nodes that are not leaves have a "children" property referencing an array of child nodes.<br><br>Example:<pre class="code poetry"><code>&lt;div ngeo-layertree=&quot;ctrl.tree&quot; ngeo-layertree-map=&quot;ctrl.map&quot; ngeo-layertree-nodelayer=&quot;ctrl.getLayer(node)&quot; ngeo-layertree-listeners=&quot;ctrl.listeners(treeScope, treeCtrl)&quot;&gt; &lt;/div&gt;</code></pre>The "ngeo-layertree", "ngeo-layertree-map" and "ngeo-layertree-nodelayer" attributes are mandatory attributes.<br><br><ul><li>"ngeo-layertree" specifies an expression providing the tree. The</li></ul> directive watches that expression, making it possible to retrieve the tree data through Ajax.<br><br><ul><li>"ngeo-layertree-map" specifies an expression providing the OpenLayers</li></ul> map. The directive doesn't watch that expression.<br><br><ul><li>The "ngeo-layertree-nodelayer" specifies an expression providing the</li></ul> layer for a given node. In most cases that expression will be function call with "node" as the argument to the function call. E.g. "ngeo-layertree-nodelayer="ctrl.getLayer(node)".<br><br><ul><li>The "ngeo-layertree-listeners" specifies an expression providing a function</li></ul> to bind scope events to customs functions. You'll must set the listener on the "treeScope" and probably use "treeCtrl" as context. E.g. "ngeo-layertree-listeners="ctrl.listeners(treeScope, treeCtrl)".<br><br>The directive comes with a default template. That template assumes that tree nodes that are not leaves have a "children" property referencing an array of child nodes. It also assumes that nodes have a "name" property.<br><br>By default the directive uses "layertree.html" as its templateUrl. This can be changed by redefining the "ngeoLayertreeTemplateUrl" value (using app.module.value('ngeoLayertreeTemplateUrl', 'path/layertree.html'), or by adding an "ngeo-layertree-templateurl" attribute to the element.<br><br>Example:<pre class="code poetry"><code>&lt;div ngeo-layertree=&quot;ctrl.tree&quot; ngeo-layertree-templateurl=&quot;path/to/layertree.html&quot; ngeo-layertree-map=&quot;ctrl.map&quot; ngeo-layertree-nodelayer=&quot;ctrl.getLayer(node)&quot; ngeo-layertree-listeners=&quot;ctrl.listeners(treeScope, treeCtrl)&quot; &lt;/div&gt;</code></pre>The directive has its own scope, but it is not an isolate scope. That scope has a "layertreeCtrl" property which is a reference to the directive's controller: "layertreeCtrl". You can refer to that property in a custom template for example.<br><br>See our live example: <a href="../examples/layertree.html">../examples/layertree.html</a><br><br><em>@htmlAttribute</em> — {Object} ngeo-layertree One theme (JSON).<br><br><em>@htmlAttribute</em> — {string} ngeo-layertree-templateurl The template URL.<br><br><em>@htmlAttribute</em> — {import('ol/Map').default} ngeo-layertree-map The map.<br><br><em>@htmlAttribute</em><br><br>{string} ngeo-layertree-nodelayer Expression that will be parsed to be a {@link Function} that return a {@link import ('ol/layer/Layer').default} with the argument: { 'node': {@link Object}|undefined, 'depth': {@link number }}<br><br><em>@htmlAttribute</em><br><br>{string} ngeo-layertree-nodelayerexpr Expression that will be parsed to be a {@link ngeo-layertree-nodelayer }.<br><br><em>@htmlAttribute</em><br><br>{string} ngeo-layertree-listeners Expression that will be parsed to be a {@link Function} with the argument: { 'treeScope': !{@link angular.IScope}, 'treeCtrl': {@link import ('ngeo/layertree/Controller').LayertreeController}}<br><br><em>@htmlAttribute</em><br><br>{string} ngeo-layertree-listenersexpr Expression that will be parsed to be a {@link ngeo-layertree-listeners }.<br><br><em>@param</em> <code>ngeoLayertreeTemplateUrl</code> — Template URL for the directive.<br><br><em>@returns</em> — The Directive Definition Object.<br><br><em>@ngInject</em><br><br><em>@ngdoc</em> — directive<br><br><em>@ngname</em> — ngeoLayertree</div></pre>
    /camptocamp/ngeo mit
    0
  • //...
    myModule.directive('ngeoDrawfeature', drawComponent);
    
    export default myModule;
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">const</span> myModule<span class="token operator">:</span> angular<span class="token punctuation">.</span>IModule</code><div class="typing-tooltip-markup"><em>@type</em> — {angular.IModule}<br><br><em>@hidden</em></div></pre>
    /camptocamp/ngeo mit
    0
  • //...
    const moduleName =
      'ovhManagerTelecomComponentsTelecomTelephonyAliasSvaGenerator';
    
    angular
      .module(moduleName, [
        ngOvhTelecomUniverseComponents,
        'ngTranslateAsyncLoader',
        'pascalprecht.translate',
        'ovh-api-services',
        'ui.router',
      ])
      .directive('svaGenerator', directive)
      .run(/* @ngTranslationsInject:json ./translations */);
    
    export default moduleName;
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">const</span> moduleName<span class="token operator">:</span> <span class="token string">"ovhManagerTelecomComponentsTelecomTelephonyAliasSvaGenerator"</span></code></pre>
    /ovh/manager BSD-3-Clause
    0
  • import angular from 'angular';
    
    import tucFileReaderDirective from './file-reader.directive';
    import './file-reader.less';
    
    const moduleName = 'tucFileReader';
    
    angular
      .module(moduleName, [])
      .directive('tucFileReader', tucFileReaderDirective);
    
    export default moduleName;
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> angular</code></pre>
    /ovh-ux/ng-ovh-telecom-universe-components bsd-3-clause
    0
  • 
    
    angular
      .module(moduleName, [
        ngOvhTelecomUniverseComponents,
        'ngTranslateAsyncLoader',
        'pascalprecht.translate',
        'ovh-api-services',
        'ui.router',
        timeConditionComponent,
        events,
        filters,
        params,
      ])
      .directive('telephonyScheduler', directive)
      .run(/* @ngTranslationsInject:json ./translations */);
    
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> angular</code></pre>
    /ovh/manager BSD-3-Clause
    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
  • import { Component } from '@angular/core';
    
    @Component ({
      selector: 'hello-world-interpolation',
      templateUrl: './hello-world-interpolation.component.html'
    })
    export class HelloWorldInterpolationComponent {
        message = 'Hello, World!';
    }
    <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 { Component } from '@angular/core';
    
    @Component({
      selector: 'hello-world',
      template: `
        <h2>Hello World</h2>
        <p>This is my first component!</p>
      `
    })
    export class HelloWorldComponent {
      // The code in this class drives the component's behavior.
    }
    <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
  • @Component({
      selector: 'my-component',
      template: '<span *ngIf="person"> {{person.address.street}} </span>'
    })
    class MyComponent {
      person?: Person;
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • import { Component } from '@angular/core';
    import { FormBuilder } from '@angular/forms';
    
    @Component({
      selector: 'app-profile-editor',
      templateUrl: './profile-editor.component.html',
      styleUrls: ['./profile-editor.component.css']
    })
    export class ProfileEditorComponent {
      profileForm = this.fb.group({
        firstName: [''],
        lastName: [''],
        address: this.fb.group({
          street: [''],
          city: [''],
          state: [''],
          zip: ['']
        }),
      });
    
      constructor(private fb: FormBuilder) { }
    }
    <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
  • @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
  • @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() items: Item[] = [];
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • @Component({
      selector: 'toh-hero',
      template: `...`
    })
    export class HeroComponent {
      @Input() id?: string;
    
      process() {
        if (this.id) {
          // ...
        }
      }
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • import { NgModule } from '@angular/core';
    import { CommonModule } from '@angular/common';
    
    @NgModule({
      imports: [
        CommonModule
      ],
      declarations: []
    })
    export class CustomerDashboardModule { }
    <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
  • @NgModule({
      declarations: [TypicalComponent]
    })
    export class TypicalModule {}
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • class TypicalServer {
    
    }
    
    export const ɵ0 = () => new TypicalServer();
    
    @NgModule({
      providers: [{provide: SERVER, useFactory: ɵ0}]
    })
    export class TypicalModule {}
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">class</span> <span class="token class-name">TypicalServer</span></code></pre>
    Docs
    0
  • import { BrowserModule } from '@angular/platform-browser';
    import { ReactiveFormsModule } from '@angular/forms';
    import { NgModule } from '@angular/core';
    
    import { AppComponent } from './app.component';
    import { DynamicFormComponent } from './dynamic-form.component';
    import { DynamicFormQuestionComponent } from './dynamic-form-question.component';
    
    @NgModule({
      imports: [ BrowserModule, ReactiveFormsModule ],
      declarations: [ AppComponent, DynamicFormComponent, DynamicFormQuestionComponent ],
      bootstrap: [ AppComponent ]
    })
    export class AppModule {
      constructor() {
      }
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> BrowserModule</code></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
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples