Hi all,

I am trying to implement a modal dialog for user switching which can be 
enabled or disabled using buttons. If the dialog is enabled, the input 
element for the user name should be focussed.

You can find my approach at 
https://plnkr.co/edit/aJ8S1A6aaUamqhwLjIVF?p=preview

The problem I have is that I need to register an AfterViewChecked callback 
in which I update the FocusDirective using an EventEmitter. Previously, I 
called `this.focusUsername.emit` directly in `setVisible`. However, this 
had no effect. I suspect that this is caused by the contemporary 
(de)activation of the dialog, such that the set focus is removed if the 
dialog is internally refreshed and rendered by angular. Nevertheless, the 
callback gets invoked every time I click in the UI, which is far from 
optimal.

Does anyone have a suggestion on how to improve my solution?

Many thanks in advance,
Björn

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to