I have a bunch of attributes that pertain to a specific functionality. They are quite a pain to write so I decided that it would be best to write it as a directive.
The problem is there doesn't seem to be a simple way to add attributes in a directive. For example, in this question, to add the directive compile has to still be called, and it's using the attr method of jqlite.
And that is the problem: directives as a usable component, how would I add attributes painlessly?
For example, if I want to add an ng-class, it's not going to be easy because there would have to be string manipulation ('{myClass:foo}' + '{directiveClass:bar}', to {myClass:foo, directiveClass:bar})
;
Or is it a bad idea to add attributes to directives? The problem is I can't add the attributes in a template because it must be attributes to the actual element (because it might break styles, etc.))