Accordion - Need help for a newbie :)


#1

Hi everyone,

I try to create an accordion list, but my level in coding is bad… I succes to create item in my 3 sublists, but now I want to add the url and some icons to my items.


HTML

  
      
  {{aett.name}} {{aett.icons}} {{item}}

CONTROLLERS

  $scope.aetts = [];
  var aetts_str = ['Ætt de Freyr','Ætt d\'Hagal','Ætt de Týr'];
  for (i = 0; i < aetts_str.length; i++) {
    $scope.aetts[i] = {
      name: aetts_str[i],
      items: [],
      liens: [],
      icons: []
    };

    var icons_str0 = ['F','U','T','A','R','K','G','W'];
    var icons_str1 = ['F','U','T','A','R','K','G','W']; // just for test
    var icons_str2 = ['F','U','T','A','R','K','G','W'];

    var liens_str0 = ['Fehu','Uruz','Thurisaz','Ansuz','Raido','Kaunan','Gebo','Wunjo'];
    var liens_str1 = ['Fehu','Uruz','Thurisaz','Ansuz','Raido','Kaunan','Gebo','Wunjo']; // just for test
    var liens_str2 = ['Fehu','Uruz','Thurisaz','Ansuz','Raido','Kaunan','Gebo','Wunjo'];

    var rune_str0 = ['Fehu | Feoh','Ūruz | Úr','Thurisaz | Thorn','Ansuz | Ás','Raidō | Rad','Kaunan | Ken','Gebō | Gyfu','Wunjō | Wynn'];
    var rune_str1 = ['Hagalaz | Hagall','Naudiz | Nyd','Īsaz | Is','Jēran | Ger','Eihwaz | Ēoh','Perthō | Peorth','Algiz | Elhaz','Sōwilō | Sigel'];
    var rune_str2 = ['Tīwaz / Týr','Berkanan | Beorc','Ehwaz | Eh','Mannaz | Man','Laukaz | Lagu','Ingwaz | Ing','Dagaz | Dag','Ōthala | Ódal'];

    for (var j=0; j < rune_str0.length; j++) {
  if (i == 0) { $scope.aetts[i].items.push(rune_str0[j]); }
  if (i == 1) { $scope.aetts[i].items.push(rune_str1[j]); }
  if (i == 2) { $scope.aetts[i].items.push(rune_str2[j]); }
    };
  
}

I don’t understand the method to put the links and the icons in correct place. I try some variations, with no result. I think, it’s because I’m not fully understand what I code :frowning:

manually, i got this : see picture

Thanks for help :slight_smile:


#2

Please format correctly your post, it’s unreadable.


#3

I think it’s good now :slight_smile: sorry for that ;(