Last active
April 21, 2018 23:43
-
-
Save shlomiassaf/0ee4242dc589a6597249bd8c97c79aaf to your computer and use it in GitHub Desktop.
angular-general-purpose-template-var.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Directive, Input } from '@angular/core'; | |
@Directive({ | |
selector: '[var]', | |
exportAs: 'var' | |
}) | |
export class VarDirective { | |
[key: string]: any; | |
@Input('var') set assign(value : any) { | |
if (value) { | |
Object.assign(this, value); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment