Created
March 27, 2016 16:54
-
-
Save jamsesso/dc17ab6d1df7823b6f44 to your computer and use it in GitHub Desktop.
ES6 Directives in Angular - factoryize
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 { Inject } from 'decorators'; | |
function factoryize(directive) { | |
return directive.$inject | |
? Inject(...directive.$inject)((...dependencies) => new directive(...dependencies)) | |
: () => new directive(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment