Does Angular Dart support ng-repeat-start and ng-repeat-end? - dart

AngularJS supports a ng-repeat-start and ng-repeat-end directive to have the ng-repeat repeat with several elements that are siblings. Is there a similar feature in Angular Dart or a different method to accomplish this?
I am trying to loop through a menu object and display it in a Bootstrap dropdown menu. Every time I repeat the dropdown-header element I would like the divider to appear before it (except the first time, which I will deal with later).
<div class="btn-group open">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
Dropdown <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li class="dropdown-header">Category 1</li>
<li>Item 1</li>
<li>Item 2</li>
<li class="divider"></li>
<li class="dropdown-header">Category 2</li>
<li>Item 3</li>
<li>Item 4<a></a></li><a>
</a></ul><a>
</a></div>
Demo
Here's what I have but I'm not sure what to do with the divider:
<ul class="dropdown-menu" ng-if="menuItem.hasSubPages">
<li class="divider"></li><!-- not sure what to do with this -->
<li ng-class="{'dropdown-header': subMenuItem.isCategory}" ng-repeat="subMenuItem in menuItem.subMenuItems" ng-switch="subMenuItem.isCategory">
{{subMenuItem.name}}
<span ng-switch-when="true">{{subMenuItem.name}}</span>
</li>
</ul>
Thanks!

Actually AngularDart doesn't support the ng-repeat-start and ng-repeat-end directives.
As you can see in the AngularDart API, no reference is available for this kind of directive.
BUT you can accomplish what you want by encapsulating the elements into a new Component as explained here : Creating a Custom Component

Related

Bootstrap collapsible menu item in side nav does not have arrow toggle

New to Bootstrap, CSS and HTML. My question is about side-navigation menu item behavior, particularly for collapsible menu items. I'd like the user to know that some items have sub-items, by showing the menu toggle item next to them. I have tried to use the data-bs-toggle class in Bootstrap to build collapsible menu item in the side nav bar. That works and correctly expands downwards/collapses upwards, except it doesn't have the toggle up/down arrow next to it. So the user doesn't know it is a dropdown menu. If I change my class on the list menu item to dropdown-menu then the sub-menu items overlay on top of the other menu items below, rather than sliding them down and expanding downwards.
Here is my code:
<li>
<a href="#submenu1" data-bs-toggle="collapse" class="nav-link px-0 align-middle">
<i class="fs-4 bi-speedometer2"></i> <span class="ms-1 d-none d-sm-inline sidenavlink">Concepts</span></a>
<ul class="collapse show nav flex-column ms-1" id="submenu1" data-bs-parent="#menu">
<li class="w-100">
<span class="d-none d-sm-inline sidenavlink">Item 1</span>
</li>
<li>
<span class="d-none d-sm-inline sidenavlink">Item 2</span>
</li>
</ul>
</li>
Here is the alternate code that I tried but it doesn't expand like the menu above...
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Resources
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="#">How To Guide</a></li>
<li><a class="dropdown-item" href="#">List Of All Words</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Contribute A Word</a></li>
</ul>
</li>
So all I'm missing is -- how do I retain my side navigation behavior exactly like it is, but add a toggle icon so the user knows to expand/collapse.
TIA for assistance.

Knockout and punches plugin not rendering undefined observables

I wrote the following code to populate a menu item:
<li class="dropdown">
Wallets <span class="caret"></span>
<ul class="dropdown-menu">
{{#if: !wallets}}
<li><a><i class="fa fa-spinner fa-pulse"></i> Loading...</a></li>
{{/if}}
{{#foreach: wallets}}
<li>
{{linkText}}
</li>
{{/foreach}}
<li role="separator" class="divider"></li>
<li><i class="fa fa-fw fa-edit"></i> Add new</li>
</ul>
</li>
I'm using knockout.punches as I'm more into curly braces than data-binding every element. wallets is an observable array loaded and kept up-to-date by SignalR.
Ok so far, but this is the way the code is rendered before the wallets observable is defined:
I'm new to knockout so maybe there's some clue I don't know about, but in general I've found little information on punches extension. Where am I wrong?

Right align nav-pills drop down menu

I am trying to align my drop down menu along the right side. Please see the attached picture and reference HTML code. Only a float right has been applied via CSS to move the drop down to the right side of the screen.
<li class="dropdown" id="it"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">IT Tools
<span class="caret"></span></a>
<ul class="dropdown-menu" id="drop">
<li>Printer Info</li>
<li>Ricoh Support</li>
<li>Paper Cut</li>
<li>Nagios</li>
</ul>
</li>
I simply added dropdown-menu-right in this bit:
<ul class="dropdown-menu dropdown-menu-right">
It worked for me!

Why does this bootstrap dropdown disappear when one item is clicked but not the other?

The following item list code is inside of a navbar with navbar-fixed-top. The code below is output that was originally written as haml code.
Why does the "Manage Teams" item close the dropdown menu, but "Add sale ..." does not?
<li class="dropdown open" id="settings-drop">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button">
<span class="glyphicon glyphicon-plus"></span>
</a>
<ul aria-labelledby="settings-drop" class="dropdown-menu" role="menu">
<li role="presentation">
<a data-remote="true" href="http://localhost:3000/sales/new?referer=notifications" role="menuitem">Add sale ...</a>
</li>
<li role="presentation">
Manage Teams
</li>
</ul>
</li>
It seems like the data-remote="true" hash is somehow interfering with bootstraps ability to detect the item being clicked on and close it.

Rounded check box using Jquery mobile

I am trying to create rounded style checkbox using Jquery mobile. In the below link, under multiple selects, choose option select menu i saw this type of checkbox. Is it possible to create that type of checkbox in listview of JQM?
http://jquerymobile.com/test/docs/forms/selects/custom.html#&ui-state=dialog
Thanks...
<ul data-role="listview" id="options">
<li data-icon="checkbox-off"><a>test</a></li>
<li data-icon="checkbox-on"><a>test</a></li>
</ul>
This code snippet makes round edges for listview, you can have any element inside it:
<ol data-role="listview">
<li class="ui-corner-bottom ui-corner-top" data-theme="a" >List Item 1</li>
<li class="ui-corner-bottom ui-corner-top" data-theme="a">List Item 2</li>
<li class="ui-corner-bottom ui-corner-top" data-theme="a">List Item 3</li>
</ol>
See the Demo here
http://jsfiddle.net/qXr79/5/

Resources