angularjs - Is there a way to populate a angular-ui-bootstrap dropdown-toggle every time I open it? -


I want to toggle a dropdown like Facebook has made for notifications.

I need to populate a list of notifications on dropdown-toggle every time I open it with $ Http or $ resource.

I can not find any events or any variables to see. This document is here:

Whatever I have found is that the CSS class is removed / removed from the "open" dropdown when it opened / closed I could see it, but it Sounds like an ugly hack.

Is there a better way to do this? Thank you.

If you have the dropdown.js () of the Connular-U that GitHub repository In, they have unearthed a incompatible attribute that you can use to find out when you open the dropdown. It seems that this angular-eye is not in the 0.10 release of bootstrap, so you have to build your own custom.

Although there is a toggle function in it, but it is a small bug where it is not the first time you open it, then remove it, I have made a fix for this which is in the planker, which I later Will link. to angular.isDefined (isOpen) .

To change the change you made to 96, it was replaced with angular.isDefined (isOpen). In this file you can add a is-toggled attribute to the element with the drop-down class.

HTML:

  & lt; Li class = "dropdown" on-toggle = "toggle (open)" & gt; & Lt; One square = "dropdown-toggle" & gt; Click me for the dropdown, yo! & Lt; / A & gt; & Lt; Ul class = "dropdown menu" & gt; & Lt; Li ng-repeat = "option in item" & gt; & Lt; A & gt; {{Likes}} & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; In your controller:  
  $ scope.toggled = function (open) {var now = new date (); $ Log.info ('I was opened ...', open, now); If (open) {$ scope.items.push ("finally" is now opened); }};  

And here is a working worker:


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -