M
M
Maxim Ivanov2016-09-23 20:37:45
Angular
Maxim Ivanov, 2016-09-23 20:37:45

How to add custom attributes to a widget?

Made widgets

<widgets 
          data="processess" 
          typewidgets="processess" 
          titleblock="{{ title.process }}"     
          titleother="{{ title.other }}" 
          positiontooltip="right"
          divhide="{{ !processess.length ? 1 : 0 }}"  
          icon="fa-dot-circle-o"    
          click="processCreateInfo">      
        </widgets>
        
        <!-- мои процессы -->
        <widgets 
          data="myprocessess"
          typewidgets="myprocessess"
          myclass="myprocesses pagination-parent"
          titleblock="{{ title.my }}"
          positiontooltip="right"
          divhide="{{ (!myprocessess.length && myprocessess.active == 0) ? 1 : 0  }}"
          icon="fa-circle-o"
          attr="data-myprocess-id=''"    
          click="myprocessOpenInfo">      
        </widgets>

But the fact is that a certain widget should have its own attributes, but I don’t know how to make them internally,
here is the widget component:
<span class="blc tooltipped {{ $ctrl.spanclass }}" 
          ng-repeat="process in $ctrl.data" 
          ng-click="$ctrl.click(process)">

          <span class="blc-title">{{ process.title }}</span>
        
            <!--- у второго виджета внутри должно быть в этом span-теге такой атрибут
           data-myprocess-id="{{ process.id }}"
           но если его так прописать, он будет доступен для первого сгенерированного контента виджета
            -->


</span>

Each widget can have its own unique data-* attributes, which are then needed for ng-repeat, what can you think of to solve this problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question