xhuur
xhuur

Reputation: 103

AngularJS directive vs HTML styles with classes

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

Answers (1)

tymeJV
tymeJV

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

Related Questions