Skip to content

Instantly share code, notes, and snippets.

@ih2502mk
ih2502mk / Angular - custom structural directives.md
Created September 15, 2021 18:44 — forked from JanMalch/Angular - custom structural directives.md
Writing your own structural directives with context variables

Writing your own structural directives with context variables

Complete code in math.directive.ts

After reading this you will be able to create a structural directive with inputs and context variables and use it like this:

<div *math="10; exponent: 3; let input; 
            let exponent = exponent; let r = root;
 let p = power; let ctrl = controller"&gt;
@ih2502mk
ih2502mk / app.js
Last active August 29, 2015 14:08 — forked from zulfajuniadi/app.js
/*
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>VirtualDOM Example</title>
</head>
<body>
<div id="output"></div>