Skip to content

Instantly share code, notes, and snippets.

View assaftenen's full-sized avatar

Assaf assaftenen

View GitHub Profile
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { map, publishReplay, refCount } from 'rxjs/operators';
export interface Config {
componentType: string,
show: Boolean
}
@assaftenen
assaftenen / angular2-esri-loader-angular-cli-instructions.md
Created November 4, 2017 19:57 — forked from tomwayson/angular2-esri-loader-angular-cli-instructions.md
How to use angular2-esri-loader in an angular-cli application

Adding angular2-esri-loader to the app and creating a map

  1. Create a new Angular app by using angular-cli to generate a new project

  2. Install angular2-esri-loader

npm install angular2-esri-loader esri-loader --save
@tomwayson
tomwayson / angular2-esri-loader-angular-cli-instructions.md
Last active September 18, 2022 05:36 — forked from jwasilgeo/angular2-esri-loader instructions.md
How to use angular2-esri-loader in an angular-cli application

Adding angular2-esri-loader to the app and creating a map

NOTE: These instructions apply to trying to use the ArcGIS API for JavaScript in an Angular 2 application created w/ angular-cli. If you're working with more recent versions of Angular, you should use https://github.com/Esri/esri-loader instead.

  1. Create a new Angular app by using angular-cli to generate a new project

  2. Install angular2-esri-loader

npm install angular2-esri-loader esri-loader --save
@jwasilgeo
jwasilgeo / angular2-esri-loader instructions.md
Last active November 2, 2017 15:46
angular2-esri-loader instructions
@adamrecsko
adamrecsko / highlight.pipe.ts
Created May 1, 2016 20:28
Angular2 text highlight pipe
import {PipeTransform, Pipe} from 'angular2/core';
@Pipe({ name: 'highlight' })
export class HighLightPipe implements PipeTransform {
transform(text: string, [search]): string {
return search ? text.replace(new RegExp(search, 'i'), `<span class="highlight">${search}</span>`) : text;
}
}
/** Usage:
@btroncone
btroncone / ngrxintro.md
Last active February 9, 2024 15:37
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@sasxa
sasxa / emitter.service.ts
Created January 2, 2016 05:27
Angular2 Communicating between sibling components
import {Injectable, EventEmitter} from 'angular2/core';
@Injectable()
export class EmitterService {
private static _emitters: { [ID: string]: EventEmitter<any> } = {};
static get(ID: string): EventEmitter<any> {
if (!this._emitters[ID])
this._emitters[ID] = new EventEmitter();
return this._emitters[ID];