Get the component instance currently being focused.
Reset the focusing component. This method will automatically call INeedFocus.onLostFocus callback method on the current focusing component. If there is no current focusing component, this method will do nothing.
The source UI event --for example, click events, etc.-- causing the component's focus to be reset.
Set focusing component to the given component. If there is current focusing component, the NeedFocusService
will automatically call INeedFocus.onLostFocus callback method on the current focusing component before setting focus to a new
one.
The component to set focus to.
The source UI event --for example, click events, etc.-- causing this component to be focused.
Generated using TypeDoc
A
ngservice class mainly handles the logic of UI component user's focus. For example, a notification pop up which will be disappered when a user clicks on anywhere else out of its area --or, saying that losing its focus. A notification pop up component class must implement the INeedFocus interface and register itself tothisservice via setFocusingComponent method to obtain the user's focus. Then, it must implement the INeedFocus.onLostFocus method to hide itself when losing the focus. The NeedFocusService will mark a component losing the focus when the resetFocusingComponent method is called or another INeedFocus component is getting focus instead.shiorin, tee4cute
INeedFocus