angularify / angular-semantic-ui

[WiP] AngularJS native directives for Semantic UI
http://angularify.github.io/angular-semantic-ui
MIT License
383 stars 87 forks source link

Return nothing if popup is not the desired purpose #42

Open RomainLanz opened 9 years ago

RomainLanz commented 9 years ago

Hi,

There are a lot of errors on this directive, like the use of eval() and many other little things...

var title = popup_meta_data['title'];
if (title == undefined)
    title = ''

can be...

var title = popup_meta_data['title'] || '';

But, the main problem here is that popup is to generic! I've other package who use this HTML option (data-popup) and without a test to be sure that popup_meta_data is not undefined I've got a lot of error in my console.

This is just a hack. But I think you need to remove completly this component and use some convention like asm-popup or whatever (sm-* is used by the real Semantic-UI Angular component).

jspdown commented 9 years ago

I never looked at this component before. I agree with you, this directive is full of errors and pretty ugly :smile: We should use more the semantic-ui javascript library. I really dislike all calculus we make in this component. We could replace it by:

$('#element').popup();

and use all parameters the library provide: http://semantic-ui.com/modules/popup.html#/usage