Spectory Blog

Angular Directive Guidelines

By Gil M, May 24 2015

The Angular documentation for directives can be a bit intimidating so here are a few simple guidelines to creating a reusable widget in Angular. A widget is a visual element implemented via an Angular directive and tested mostly manually in a browser. If the widget performs some calculations such as date calculations for instance that do require tests, this is best done in an injected lib that is tested separately. Examples of widgets are two-way sliders, multi-select drop-downs, graphs etc., these are visual elements that have the following interface to the outside world:

Read More