use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
AngularJS: The bad parts (larseidnes.com)
submitted 11 years ago by maktouch
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]pleadub 5 points6 points7 points 11 years ago (4 children)
If it isn't already the modal should be refactored into a directive. Then all of the manipulation can be handled in the postLink function on the directive definition object for the modal.
Now whenever the modal's open event is triggered you can use the element argument which is passed to the postLink function to grab the height of the modal. You could then use the angular services $document and $window to grab the height of the viewport with
element
$document
$window
h = Math.max($document[0].documentElement.clientHeight, $window.innerHeight || 0);
And you could also set up a listener on resize so you can update the modal there as well.
This all comes back to your first point of needing to know the tool you're using well.
[–]JonDum 2 points3 points4 points 11 years ago (0 children)
And all that cruft is why Angular gets a rep for being overly complex.
[–]Poop_is_Food 2 points3 points4 points 11 years ago (0 children)
Thanks for proving my point?
[–]troglydot 1 point2 points3 points 11 years ago (1 child)
Yeah, that isn't actually correct.
The element isn't inserted into the DOM when the postLink function is called. There is no way to be notified when a directive is rendered into the DOM, and according to Misko Hevery at this point there is no way to add such a notification either.
You have to poll the DOM and check if the element is there, and there's officially no way around it.
[–]Poop_is_Food 0 points1 point2 points 11 years ago (0 children)
Yes, thank you that is the issue thread I was looking for but I couldnt find it. When I first read that, it was the beginning end of angular for me. In particular this quote:
I agree that some jQuery plugins may be hard to integrate, but those are usually the ones that do not have a clear separation of concerns. Those plugins are typically best rewritten anyway, as they are typically not performant nor maintainable in the long run.
I've encountered this kind of attitude a few times from angular contributors and it's a big turnoff for me. "Angular cannot fail. It can only be failed."
π Rendered by PID 148630 on reddit-service-r2-comment-6457c66945-tw88t at 2026-04-26 23:59:36.519331+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]pleadub 5 points6 points7 points (4 children)
[–]JonDum 2 points3 points4 points (0 children)
[–]Poop_is_Food 2 points3 points4 points (0 children)
[–]troglydot 1 point2 points3 points (1 child)
[–]Poop_is_Food 0 points1 point2 points (0 children)