Technologies

Angular

The Angular IO project can be found at the Angular.IO website. The guide is at Angular Guide

Run ng generate component component-name to generate a new component. You can also use ng generate directive/pipe/service/class/module.

TypeScript

Hammer.js

Disable Firefox Pinch to zoom browser function:

Inside about:config change:

  • browser.gesture.pinch.in to empty string
  • browser.gesture.pinch.in.shift to empty string
  • browser.gesture.pinch.out to empty string
  • browser.gesture.pinch.out.shift to empty string
  • browser.gesture.pinch.threshold to -1

Web Workers

const workerTask = new WorkerTask(workerPath, (message) => {
    const item = message.data;
    if (item === undefined) { console.log('no item'); return; }
    // don't draw glyphs that lay outside the view
    if (this.helper.checkClipping(item.position)) {
    return;
    }

    this.context.beginPath();
    this.context.moveTo(item.position.x, item.position.y);

    const data = this.getFeaturesForItem(item);

    if (this.itemConfirmsToFilters(item.id, data.features)) {
    // draw highlighted glyph after all other glyphs to render it above all others (independent of selection)
    // necessary to draw a selected and highlighted glyph above other selected glyphs
    if (item.id !== this.configuration.idOfHoveredGlyph ||
        (!this.configuration.showHighlightInNormalMode && !this.configuration.useDragSelection)) {
        this.drawSingleGlyph(item.position, feature, null, false, false, 0);
    }
    } else {
    this.drawSingleGlyph(item.position, feature, 1.0, true, item.id === this.configuration.idOfHoveredGlyph, 0);
    }
}, d);
this.pool.addWorkerTask(workerTask);

File Uploads

Using SASS in Angular Projects