Skip to content

Instantly share code, notes, and snippets.

View JohnnyBravoNL's full-sized avatar

Thomas van Rompaey JohnnyBravoNL

View GitHub Profile
@JohnnyBravoNL
JohnnyBravoNL / Custom component - reactive forms.ts
Created November 16, 2018 11:55
Custom component - reactive forms
/*
Source: https://coryrylan.com/blog/angular-custom-form-controls-with-reactive-forms-and-ngmodel
*/
import { Component, Input, forwardRef } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
@Component({
selector: 'app-switch',
templateUrl: 'app/switch.component.html',
@JohnnyBravoNL
JohnnyBravoNL / json_as_html.html
Created November 16, 2018 11:41
Show JSON as HTML in JavaScript
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function CallWebAPI() {
var responseContainer = document.getElementById('response');
var request = new XMLHttpRequest();
request.open("get", "/api/global/initialize", false);
request.send();
@JohnnyBravoNL
JohnnyBravoNL / json_as_html.html
Last active November 16, 2018 11:44
Show JSON as HTML in Angular
<pre>{{mydataobject | json}}</pre>