Search Posts

Category: twitter-bootstrap-3

Checkbox in dropdown menu is not checked from previously selected value in AngularJS

I am new to AngularJS. I am trying to get the checkbox to appear as checked from previously selected value. I thought ng-class would do the trick but it’s not. Did I do anything wrong in the code below? Here is my HTML code: <ul class=”dropdown-menu menu-content” uib-dropdown-menu> <li ng-repeat=”value in values” > <label><input type=”checkbox” ng-class=”{‘checked’ : value.selected, ‘active’ : value.selected}” ng-click=”$ctrl.toggleValue(value)”>{{value.valueName}}</label></li> </ul> Source: AngularJS

Unable to render navigation menu in angular 1 using nested json data

I want to implement a navigation bar using json data which is fetched by angular service. I ave my service and controller working great, but I am unable to render the nested json data into my view. Below is my json data: { “menu”: [ { “name”: “Electronics”, “link”: “1”, “sub”: [ { “name”: “Mobiles”, “link”: “1.1”, “sub”: [ { “name”: “Samsung”, “link”: “1.1.1”, “sub”: null }, { “name”: “Apple”, “link”: “1.1.2”, “sub”: null }, […]