How to give List different color to each item..Problem


I am trying to give different color to each list item.

.controller('SuralistsCtrl', function($scope, $state) {
  $scope.suralists = [
      id: '1',
      title: 'Item A',
      desc: '(abcdefgh)',
      backgroundColor: '#000000',
      id: '2',
      title: 'Item B',
      desc: '(abcdefgh)',
      backgroundColor: '#ffffff',

in html file

<ion-content has-header="true" scroll-watch>


      <ion-item ng-repeat="suralist in suralists" style="background-color: {{suralist.backgroundColor}}" class="item-left item-icon-left item-icon-right" href="#/app/sura{{}}" >
        <i class="icon ion-ios-book"></i>
        {{suralist.title}}<div class="item-note custom-item-note" >{{suralist.desc}}</div>
        <i class="icon ion-chevron-right custom-icon"></i>

In chrome I checked style attribute added properly but color is not changing…anybody can help me to resolve it?


Of course it’s not working, you’re trying to style an ion-item directive.

You need to do this with on a ultimately generated list div.


Oh Yea you are right. Thanks