Make sure you have Vagrant and Oracle VM Virtualbox installed on your development machine.
Download & Install
| import { Component } from '@angular/core'; | |
| import {WebSocketClient} from './websocket-client'; | |
| @Component({ | |
| selector: 'my-app', | |
| template: '<h1>Websocket connectivity: <small>{{connectivity}}</small></h1>' | |
| }) | |
| export class AppComponent { | |
| connectivity:string; | |
| constructor() { | 
Make sure you have Vagrant and Oracle VM Virtualbox installed on your development machine.
Download & Install
A Pen by Theuy Limpanont on CodePen.
| var gulp = require('gulp'); | |
| var path = require('path'); | |
| var clean = require('gulp-clean'); | |
| var gutil = require('gulp-util'); | |
| var runSequence = require('gulp-run-sequence'); | |
| gulp.task('clean:public/themes', function () { | |
| return gulp.src(path.resolve(__dirname, 'public/themes')) | |
| .pipe(clean().on('error', gutil.log)); | |
| }); | 
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="description" content="which points are in the polygons?"> | |
| <script src="https://code.jquery.com/jquery-2.1.4.js"></script> | |
| <link href="https://leafletjs-cdn.s3.amazonaws.com/content/leaflet/master/leaflet.css" rel="stylesheet" type="text/css" /> | |
| <script src="https://leafletjs-cdn.s3.amazonaws.com/content/leaflet/master/leaflet.js"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.2.3/leaflet.draw.css"> | 
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="description" content="which points are in the polygons?"> | |
| <script src="https://code.jquery.com/jquery-2.1.4.js"></script> | |
| <link href="https://leafletjs-cdn.s3.amazonaws.com/content/leaflet/master/leaflet.css" rel="stylesheet" type="text/css" /> | |
| <script src="https://leafletjs-cdn.s3.amazonaws.com/content/leaflet/master/leaflet.js"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.2.3/leaflet.draw.css"> | 
| var toggleClass = function(el, className) { | |
| if (el.classList) { | |
| el.classList.toggle(className); | |
| } else { | |
| var classes = el.className.split(' '); | |
| var existingIndex = classes.indexOf(className); | |
| if (existingIndex >= 0) | |
| classes.splice(existingIndex, 1); | |
| else | 
| { | |
| // http://eslint.org/docs/rules/ | |
| "parser": "babel-eslint", | |
| "ecmaFeatures": { | |
| "binaryLiterals": false, // enable binary literals | |
| "blockBindings": false, // enable let and const (aka block bindings) | |
| "defaultParams": false, // enable default function parameters | |
| "forOf": false, // enable for-of loops | |
| "generators": false, // enable generators | |
| "objectLiteralComputedProperties": false, // enable computed object literal property names | 
| isFilledWithValue = function(object) { | |
| for(var key in object) { | |
| var value = object[key].trim(); | |
| if(value || value.length > 0) { | |
| return true; | |
| } | |
| } | |
| return false; | |
| } |