Skip to content

Instantly share code, notes, and snippets.

View ricmello's full-sized avatar
🏠
Working from home

Ricardo Mello ricmello

🏠
Working from home
View GitHub Profile

Descrição da vaga

Procuramos dois devs full-stack acima da média para fazer parte do nosso novo time.

Local

Escritório, Rio de Janeiro - Botafogo (Possibilidade home-office)

Requisitos

declare module '@angular/common/http/src/client' {
export interface HttpClient {
hideLoader(hide?: boolean): HttpClient;
}
}
import { InjectionToken } from '@angular/core';
import { HttpClient, HttpEvent, HttpInterceptor, HttpHandler, HttpRequest } from '@angular/common/http';
import { Observable } from 'rxjs';
declare module '@angular/common/http/src/client' {
export interface HttpClient {
hideLoader(hide?: boolean): HttpClient;
}
@Injectable()
export class HttpService extends HttpClient {
constructor(private httpHandler: HttpHandler,
private injector: Injector,
@Optional() @Inject(HTTP_DYNAMIC_INTERCEPTORS) private interceptors: HttpInterceptor[] = []) {
super(httpHandler);
if (!this.interceptors) {
// Configure default interceptors that can be disabled here
providers: [
{ provide: HttpClient, useClass: HttpService },
],
public getAutoCompleteResult(term: string) {
return this.httpClient
.hideLoader()
.get(`http://my-domain/api/autocomplete`);
}
@ricmello
ricmello / collection.json
Last active June 11, 2019 05:00
Create your first schematics
{
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
"schematics": {
"my-schematics": {
"description": "A blank schematic.",
"factory": "./my-schematics/index#mySchematics"
}
}
}
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
// You don't have to export the function as default. You can also have more than one rule factory
// per file.
export function mySchematics(_options: any): Rule {
return (tree: Tree, _context: SchematicContext) => {
return tree;
};
}
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
// You don't have to export the function as default. You can also have more than one rule factory
// per file.
export function mySchematics(_options: any): Rule {
return (tree: Tree, _context: SchematicContext) => {
tree.create(_options.name || 'hello', 'world');
return tree;
};
}
{
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
"extends": ["@schematics/angular"],
"schematics": {
"my-schematics": {
"description": "A custom module generator.",
"factory": "./my-schematics/index#mySchematics",
"schema": "./my-schematics/schema.json"
}
}