angular-bootstrap-show-errors icon indicating copy to clipboard operation
angular-bootstrap-show-errors copied to clipboard

broadcast 'show-errors' event when toggling classes

Open jack-kerouac opened this issue 10 years ago • 0 comments

This event can be listened on by directives inside the show-errors directive in order to e.g. show/hide a feedback icon or other error messages.

Example:

angular.module('app')
    .directive('feedbackIcon', function () {
        return {
            link: function (scope, elem) {
                scope.$on('show-errors', function (event, invalid) {
                    elem.toggleClass('glyphicon-remove', invalid);
                    elem.toggleClass('glyphicon-ok', !invalid);
                });
            }
        };
    });

jack-kerouac avatar Feb 02 '15 14:02 jack-kerouac