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 { HttpClient } from '@angular/common/http';
    import { Pipe, PipeTransform } from '@angular/core';
    
    @Pipe({
      name: 'fetch',
      pure: false
    })
    export class FetchJsonPipe implements PipeTransform {
      private cachedData: any = null;
      private cachedUrl = '';
    
      constructor(private http: HttpClient) { }
    
      transform(url: string): any {
        if (url !== this.cachedUrl) {
          this.cachedData = null;
          this.cachedUrl = url;
          this.http.get(url).subscribe(result => this.cachedData = result);
        }
    
        return this.cachedData;
      }
    }
    Docs
  • import { ActivatedRoute } from '@angular/router';
    
    @Component({
      selector: 'app-routable',
      template: 'Routable2Component template'
    })
    export class Routable2Component implements OnInit {
      constructor(private activatedRoute: ActivatedRoute) {}
    
      ngOnInit() {
        this.activatedRoute.url
          .subscribe(url => console.log('The URL changed to: ' + url));
      }
    }
    Docs
  • //...
    myModule.value(
      'gmfHeaderTemplateUrl',
      /**
       * @param {JQuery} $element Element.
       * @param {angular.IAttributes} $attrs Attributes.
       * @returns {string} Template URL.
       */
      ($element, $attrs) => {
        const templateUrl = $attrs.gmfHeaderTemplateUrl;
        return templateUrl !== undefined ? templateUrl : 'gmf/header/component';
      }
    );
    
    
    
    //...
    
    /camptocamp/ngeo mit
  • import angular from 'angular';
    import '@uirouter/angularjs';
    import grantAdpAccessComponent from './grant-access.component';
    
    const moduleName = 'enterpriseCloudDatabaseServiceDetailsLogsGrantAccess';
    
    angular
      .module(moduleName, ['ui.router'])
      .config(
        /* @ngInject */ ($stateProvider) => {
          $stateProvider.state(
            'enterprise-cloud-database.service.details.logs.grant-access',
            {
              url: '/grant-access',
              views: {
                modal: {
                  component:
                    'enterpriseCloudDatabaseServiceDetailsLogsGrantAccessComponent',
                },
              },
              layout: 'modal',
              resolve: {
                breadcrumb: () => null,
              },
            },
          );
        },
      )
      .component(
        'enterpriseCloudDatabaseServiceDetailsLogsGrantAccessComponent',
        grantAdpAccessComponent,
      )
      .run(/* @ngTranslationsInject:json ./translations */);
    
    export default moduleName;
    
    /ovh/manager BSD-3-Clause
  • //...
    myModule.value(
      'gmfObjecteditingTemplateUrl',
      /**
       * @param {JQuery} $element Element.
       * @param {angular.IAttributes} $attrs Attributes.
       * @returns {string} Template URL.
       */
      ($element, $attrs) => {
        const templateUrl = $attrs.gmfObjecteditingTemplateurl;
        return templateUrl !== undefined ? templateUrl : 'gmf/objectediting';
      }
    );
    
    
    
    //...
    
    /camptocamp/ngeo mit
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples