Skip to content

Instantly share code, notes, and snippets.

View pheetah's full-sized avatar
🗿

Eyüp Fatih Ersoy pheetah

🗿
View GitHub Profile
@JanMalch
JanMalch / Angular - custom structural directives.md
Last active June 9, 2024 16:30
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;
@lancevo
lancevo / child.component.ts
Created August 17, 2017 19:45
Mock Child Component
import { Component, OnInit, Input } from '@angular/core';
@Component({
selector: 'app-child',
templateUrl: '<ul><li *ngFor="let i of numbers">{{i}}</li></ul>',
styleUrls: ['./child.component.css']
})
export class ChildComponent implements OnInit {
@Input() numbers: number[];