Refactoring bnRepeatSwitch To Use A Multi-Priority Directive In AngularJS

added by JavaScript Kicks
11/7/2014 3:05:46 PM


Yesterday, I demonstrated that a single directive could be bound to multiple priorities in the same compile and linking phase in AngularJS. While the coolness of this may not be obvious, I immediately thought of my previous post on the ngRepeat-optimized "switch" directive. It used two directives in order to execute on both "sides" of the native ngRepeat directive; but, given yesterday's discovery, I wanted to refactor bnRepeatSwitch to use a single directive with multiple priorities.