Created
September 23, 2015 16:21
-
-
Save morsdyce/6b0c46422c7f6294c6fd to your computer and use it in GitHub Desktop.
If-env angular directive
This file contains 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
export function ifEnv(ENV) { | |
return { | |
restrict: 'A', | |
priority: 600, | |
transclude: 'element', | |
terminal: true, | |
link: function(scope, element, attrs, ctrl, $transclude) { | |
if (ENV === attrs.ifEnv) { | |
$transclude(function (clone) { | |
element.after(clone); | |
}); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment