How to use Ng-repeat inside ng-repeat in Angularjs

Total Post:341

 1223  View(s)
Rate this:
We want to use ng-repeat inside ng-repeat in will do this please tell  me.
  1. Post:282

    Re: How to use Ng-repeat inside ng-repeat in Angularjs


    Layout = null;


    <!DOCTYPE html>




    <meta name="viewport" content="width=device-width" />

    <script src="~/Scripts/jquery-1.9.1.js"></script>

    <script src="~/Scripts/angular.js"></script>


    var app = angular.module("myApp", []);

    app.controller('MyCtrl', function ($scope) {

    $scope.menuItems = [{ Productname: 'Samsung Galaxy S6 Compare', category: 'SAMSUNG' },

    { Productname: 'Samsung Galaxy S6 Edge', category: 'SAMSUNG' },

    { Productname: 'Compare Samsung Galaxy Core ', category: 'SAMSUNG' },

    { Productname: 'Lenovo Vibe Shot', category: 'Lenovo' },

    { Productname: 'Lenovo A6000', category: 'Lenovo' },

    { Productname: 'Lenovo K3 Note', category: 'Lenovo' }


    $scope.categories = ['Lenovo', 'SAMSUNG']




    <body ng-app="myApp" ng-controller="MyCtrl">


    <ul ng-repeat="ca in categories">

    <li style="font-weight:bold;">{{ca}}</li>

    <li ng-repeat="menuItem in menuItems | filter:{category: ca}">{{menuItem.Productname}}</li>





      Modified On Apr-11-2018 01:51:39 AM