Skip to content

Instantly share code, notes, and snippets.

View timdeschryver's full-sized avatar
👟

Tim Deschryver timdeschryver

👟
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Map</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY"></script>
</head>
import { BrowserModule } from '@angular/platform-browser'
import { NgModule } from '@angular/core'
import { GoogleMapsModule } from '@angular/google-maps'
import { AppComponent } from './app.component'
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, GoogleMapsModule],
providers: [],
bootstrap: [AppComponent],
})
@timdeschryver
timdeschryver / machine.js
Created October 31, 2019 15:03
Generated by XState Viz: https://xstate.js.org/viz
const appointmentMachine = Machine({
id: 'appointment',
context: {
appointment: null
},
initial: 'save',
states: {
save: {
invoke: [
@timdeschryver
timdeschryver / machine.js
Last active October 16, 2019 18:28
Generated by XState Viz: https://xstate.js.org/viz
const countMachine = Machine(
{
id: "counter",
context: {
counter: 10,
tickSpeed: 1000,
countDiff: 1,
},
initial: "paused",
@timdeschryver
timdeschryver / machine.js
Last active October 11, 2019 12:02
Generated by XState Viz: https://xstate.js.org/viz
const dragMachine = Machine(
{
key: 'ngx-drag-to-select',
initial: 'clickMode',
context: {
shortcuts: {},
selectWithShortcut: false,
x1: 0,
y1: 0,
describe('createSelectorFactoryWithCache', () => {
const mockState = {
propA: {
a: 1,
b: 2,
c: 3,
},
propB: {
d: 4,
e: 5,
<!-- Only the name is required -->
<person></person>
<!-- The name and the contactInfo are required -->
<person stage-one></person>
<!-- All fields are required -->
<person stage-two></person>
@Directive({
selector: 'person[stage-two]',
})
export class StageTwoDirective {
constructor(host: PersonComponent) {
host.form.get('contactInfo').setValidators([Validators.required])
host.form.get('allergies').setValidators([Validators.required])
}
}
@Directive({
selector: 'person[stage-one]',
})
export class StageOneDirective {
constructor(host: PersonComponent) {
host.form.get('contactInfo').setValidators([Validators.required])
}
}