
- Mobile Angular UI Tutorial
- Mobile Angular UI - Home
- Mobile Angular UI - Overview
- Mobile Angular UI - Installation
- Mobile Angular UI - Project Setup
- Mobile Angular UI - My First App
- Mobile Angular UI - Layouts
- Mobile Angular UI - Components
- Mobile Angular UI - Dropdowns
- Mobile Angular UI - Accordions
- Mobile Angular UI - Tabs
- Mobile Angular UI - Drag and Drop
- Mobile Angular UI - Scrollable Areas
- Mobile Angular UI - Forms
- Mobile Angular UI - Swipe Gestures
- Mobile Angular UI - Toggle Switch
- Mobile Angular UI - Sections
- Mobile Angular UI - Core Details
- Mobile Angular UI - Touch Events
- Mobile Angular UI - PhoneGap & Cordova
- Mobile Angular UI - Creating APK File
- Mobile Angular UI - APP Development
- Mobile Angular UI - Examples
- Mobile Angular UI Resources
- Mobile Angular UI - Quick Guide
- Mobile Angular UI - Useful Resources
- Mobile Angular UI - Discussion
Mobile Angular UI - outerClick
As per the name Outerclick it helps to add a behaviour based on click/tap that happens outside the html element. It is mostly useful to close dropdowns that are open when clicked outside the dropdown area.
The core sub-module outerClick comes with two important directives called as ui-outer-click and ui-outer-click-if.
Let us take a look at an example −
We will add the changes in src/home/home.html.
<div class="list-group text-center"> <div class="list-group-item list-group-item-home"> <h1>{{msg}}</h1> </div> <div class="list-group-item list-group-item-home"> <div class="btn-group"> <a ui-turn-on='testDropdown' class='btn'> <i class="fa fa-caret-down" aria-hidden="true"></i>Tutorials </a> <ul class="dropdown-menu" ui-outer-click="Ui.turnOff('testDropdown')" ui-outer-click-if="Ui.active('testDropdown')" role="menu" ui-show="testDropdown" ui-state="testDropdown" ui-turn-off="testDropdown"> <li><a>PHP</a></li> <li><a>JAVA</a></li> <li><a>MYSQL</a></li> <li class="divider"></li> <li><a>PYTHON</a></li> </ul> </div> </div> </div>
Make use of ui-outer-click to when Outer Click event happens. You can also call a function to do something specific as per your project. Make use of Use ui-outer-click-if parameter to enable/disable the listener.
We are having a list of Tutorials shown in the dropdown. The output on the screen is as follows −

mobile_angular_ui_core_details.htm
Advertisements