Simple Popup

1,280 views
Skip to first unread message

Anna Vester

unread,
Oct 22, 2012, 1:53:14 PM10/22/12
to ang...@googlegroups.com
Hello group, so I've been toying around with creating a simple popup, here is my fiddle - http://jsfiddle.net/annavester/VdfVp/5/

Now, i want it to work as close as possible to the angular way. Is it getting there? Also, for some reason, it only fires on the first click event. I believe I have mishandled something in the directive.

Any tips on how to improve this are very welcome.

Thanks.

Anna

Pawel Kozlowski

unread,
Oct 22, 2012, 3:07:41 PM10/22/12
to ang...@googlegroups.com
Hi Anna,

I guess that everyone has a slightly different opinion on what the
AngularJS way but for me:

1) I would avoid jQuery if I can. Don't get me wrong, jQuery is great
but many times we can get away with the built-in jquery light. I'm
simply trying to avoid dependencies if I can.

2) Somehow I like the model to drive everything, here is my take at
the problem: http://jsfiddle.net/JMWnt/4/

3) The above implementation has an issue since we are listening to the
mouseout on a button, why people would probably expect it to act on
the popup. The whole thing can be done without using directives:
http://jsfiddle.net/NRpdK/3/; I guess that you were doing this to
learn directives - in this case you might have a look at Andy's
implementation of the boostrap's modal:
https://github.com/angular-ui/bootstrap/blob/master/src/modal/modal.js
which deals with show / hide problematic.

Hope this helps,
Pawel
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To post to this group, send email to ang...@googlegroups.com.
> To unsubscribe from this group, send email to
> angular+u...@googlegroups.com.
> Visit this group at http://groups.google.com/group/angular?hl=en.
>
>



--
Question? Send a fiddle
(http://jsfiddle.net/pkozlowski_opensource/Q2NpJ/) or a plunk
(http://plnkr.co/)
Need help with jsFiddle? Check this:
http://pkozlowskios.wordpress.com/2012/08/12/using-jsfiddle-with-angularjs/

Looking for UI widget library for AngularJS? Here you go:
http://angular-ui.github.com/

Anna Vester

unread,
Oct 22, 2012, 5:02:07 PM10/22/12
to ang...@googlegroups.com
Pawel, 

This is really neat. I really like the model version. Thanks for this.

Anna
Reply all
Reply to author
Forward
0 new messages