Skip to content

Instantly share code, notes, and snippets.

@Borzilov
Borzilov / Angular - custom structural directives.md
Created May 17, 2019 20:19 — 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;