AngulrJs Ui-tree Search problem with same title

77 Views Asked by At

I need to search on all nodes, but here I have two title with same name (SameTitle) in demolist.js. I want a search operation on whole node.

Expected result: (SameTitle) should appear twice with parent name as given in demolist.js.

But it appears only once with first Node parent name. Is there any way to solve this issue?

(function() {
angular.module('demoApp.list',[])
.value('MyList',[
{
  "id": 1,
  "title": "ASD Headquarters",
  "items": [
    {
      "id": 11,
      "title": "SameTitle",
      "items": [
        {
         "id":13,
         "title":"Jensen Chapman's Team",
         "items": [
            {
              "id":14,
              "title":"Jimmy John"
            },
            {
              "id":15,
              "title":"Daniel Mills"
            }
            ,
            {
              "id":16,
              "title":"Chris Boden"
            }
           ]
        }
        ],
    },
    {
      "id": 12,
      "title": "Irvine",
      "items": [
        {
         "id":23,
         "title":"Tracey Chapman's Team",
         "items": [
            {
              "id":24,
              "title":"San Jesus"
            },
            {
              "id":25,
              "title":"Fat Albert"
            }
            ,
            {
              "id":26,
              "title":"Connor McDavid"
            }
           ]
        }
        ]
    },
    {
      "id":30,
      "title":"San Diego",
      "items": [{
        "id":31,
        "title":"Duran Duran's Team",
        "items":[
             {
              "id":32,
              "title":"Amberlynn Pinkerton"
            },
            {
              "id":33,
              "title":"Tony Mejia"
            }
            ,
            {
              "id":34,
              "title":"Richard Partridge"
            }
            ,
            {
              "id":35,
              "title":"Elliot Stabler"
            }
          ]
        },
        {
        "id":40,
        "title":"Steely Dan's Team",
        "items":[
             {
              "id":36,
              "title":"Tony Stark"
            },
            {
              "id":37,
              "title":"Totally Rad"
            }
            ,
            {
              "id":38,
              "title":"Matt Murdock"
            }
            ,
            {
              "id":39,
              "title":"Stan Lee"
            }
          ]
        }
      ]
    }
  ]
},{
  "id": 2,
  "title": "ASD",
  "items": [
    {
      "id": 122,
      "title": "SameTitle",
      "items": [
        {
         "id":123,
         "title":"Jensen Chapman's Team",
         "items": [
            {
              "id":124,
              "title":"Jimmy John"
            },
            {
              "id":125,
              "title":"Daniel Mills"
            }
            ,
            {
              "id":126,
              "title":"Chris Boden"
            }
           ]
        }
        ],
    },
    {
      "id": 127,
      "title": "Irvine",
      "items": [
        {
         "id":128,
         "title":"Tracey Chapman's Team",
         "items": [
            {
              "id":129,
              "title":"San Jesus"
            },
            {
              "id":130,
              "title":"Fat Albert"
            }
            ,
            {
              "id":140,
              "title":"Connor McDavid"
            }
           ]
        }
        ]
    },
    {
      "id":320,
      "title":"San Diego",
      "items": [{
        "id":235,
        "title":"Duran Duran's Team",
        "items":[
             {
              "id":855,
              "title":"Amberlynn Pinkerton"
            },
            {
              "id":963,
              "title":"Tony Mejia"
            }
            ,
            {
              "id":874,
              "title":"Richard Partridge"
            }
            ,
            {
              "id":8645,
              "title":"Elliot Stabler"
            }
          ]
        },
        {
        "id":946,
        "title":"Steely Dan's Team",
        "items":[
             {
              "id":878,
              "title":"Tony Stark"
            },
            {
              "id":020,
              "title":"Totally Rad"
            }
            ,
            {
              "id":29526,
              "title":"Matt Murdock"
            }
            ,
            {
              "id":874,
              "title":"Stan Lee"
            }
          ]
        }
      ]
    }
  ]
}
]);

})()

Plunker for this problem

0

There are 0 best solutions below