You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ang...@googlegroups.com
Hey, all. I have a navbar (Bootstrap 3, but no angularUI-bootstrap involved), and a couple of the navbar items in the dropdown are conditionally displayed based on the presence/absence of a 'user' object stored in the $rootScope. When selected, a user dialog asks the user for creds, and I send them off to the authentication server for a response, and the results come back asynchronously.
I'm looking for a 100% sure-fire way to update the navbar contents when the user object comes back. I've tried $rootScope.$apply, but that seems to periodically come back with a "$apply already in effect" error, and when I don't do $apply, it doesn't seem like the navbar is always being updated.
Very open to suggestions here....
Grant Rettke
unread,
Sep 15, 2013, 8:09:03 AM9/15/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ang...@googlegroups.com
Perhaps a basic directive just so that you don't have to call apply yourself.
--
Grant Rettke | ACM, AMA, COG, IEEE
gre...@acm.org | http://www.wisdomandwonder.com/ “Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson
Ted Neward
unread,
Sep 15, 2013, 8:54:45 AM9/15/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ang...@googlegroups.com, ang...@googlegroups.com
Not sure what you mean; what would the directive do?
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ang...@googlegroups.com
There's two ways:
One is to use $timeout (i.e. instead of $rootScope.$apply(function() {
... }), do $timeout(function() { ... }) )
Another way is to use safeApply (look at the first comment of this
blogpost - if you copy it exactly as is, it will create the safeApply
method for you: https://coderwall.com/p/ngisma )