Last active
August 29, 2015 14:14
-
-
Save nachinius/0a40f4f66cee830bd423 to your computer and use it in GitHub Desktop.
couple of 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
// angular.module('mymodule').directive('showAlertError', function() { | |
// return { | |
// restrict: 'E', | |
// scope: { | |
// key: '=key', | |
// alerts: '=alerts' | |
// }, | |
// template: '<div ng-show="alerts.by_key[key]">{{alerts.by_key[key].message}}</div>', | |
// link: function(scope, elm, attrs) { | |
// } | |
// } | |
// }); | |
angular.module('mymodule').directive('showIfExists', function() { | |
return { | |
restrict: 'E', | |
scope: { | |
value: '=value', | |
}, | |
template: '<div class="error" ng-show="value">{{value}}</div>', | |
link: function(scope, elm, attrs) { | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment