Reputation: 103
I'm writing a single page web application using AngularJS framework with angular-ui extension.
I want to create my own look and feel for all kind of GUI components like DropdownList, DatePicker and other custom components.
When should I write custom directives and when should I use HTML tags like div, and span whith css classes (borders, background, additional buttons when hovering and more) in order to accomplish that?
Is it better or worse to create custom directives or html tags with classes?
What do you think?
Thanks
Upvotes: 2
Views: 634
Reputation: 104775
Directives are used for DOM manipulation - if you can achieve what you want with only a class, then do it. If you need to use different HTML elements / alter the functionality of the elements, apply a directive.
Upvotes: 1