You can create a
Front-end @ Hypersonix
Directives are classes that add additional behavior to elements in your Angular applications.
- Components - directives with a template.
- Attribute directives - change the appearance or behavior of an element, component, or another directive.
- Structural directives - change the DOM layout by adding and removing DOM elements.
- Access to the native element
- Access to template reference
- Listen and Handle events
- Input Validations
- Lean Components
Directives in Action
Delta Value Directive
Attribute directive to add classes based on some condition.
Takes a number as input
Checks if the number is positive or negative
Just adds a class to the host element
Add arrow based on the change
Exports the directive to be used in a template
Manage state inside the directive
Displays content only if authorized
Pass feature and permission as input
Validates the permission and embed the item in view
Demo & Code
You can create a directive for that!