Hi I am developing SPA using angularjs . I have one dropdown. If the user logs in then dropdown will be clickable and it expands various options like profile,logout etc. In app.js i have below code to expand dropdown
if (cookieloginid != null) {
var id = document.getElementById('ProfileDropdown');
id.innerHTML = $scope.ProfileDropdown = '<div data-drop-down>' + ' <ul>' +
'<li><a href="#/userProfile">User Profile</a></li>' +
'<li>test1</li>' +
' <li onclick="logout(event)">logout</li>' +
'</ul>'+'</div>';
}
Above code works fine. If i click on dropdown that will expand and not close. After clicking on dropdown if i click anywhere on web page i want to close the expanded dropdown. May i know is this possible? Any help would be appreciated. Thank you.
angular.element('#ProfileDropdown').triggerHandler('Click')on page load