// jQuery
$(document).ready(function() {
// code
})
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {Subscription} from 'rxjs/Subscription'; | |
| /* | |
| If you are using subscriptions in a component these should always be unsubscribed when the component is destroyed. | |
| In order to make it easier to handle subscriptions this class can be used. | |
| How to use it: | |
| 1.) Create an private attribute "private subscrManager = new SubscriptionManager();" in your component | |
| 2.) Wrap your subscription calls in: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # INSTRUCTION: | |
| # There are two options for the redirection: | |
| # Option 1) (default): Your app is directly on the root of the domain. | |
| # Option 2): Your app is placed in a subfolder from the root of the domain. | |
| # | |
| # If you have issues with browser caching you can uncomment the BROWSER CACHING part | |
| # For new versions of this Gist go to: | |
| # https://gist.github.com/julianpoemp/bcf277cb56d2420cc53ec630a04a3566 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| self.addEventListener('install', (e) => { | |
| e.waitUntil( | |
| caches.open("precache").then((cache) => cache.add("/broken.png")) | |
| ); | |
| }); | |
| function isImage(fetchRequest) { | |
| return fetchRequest.method === "GET" && fetchRequest.destination === "image"; | |
| } |
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.
Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.