M
M
Maxim Iralov2021-03-02 15:35:44
Angular
Maxim Iralov, 2021-03-02 15:35:44

How to correctly enter the value of a variable into a function argument in angularJS?

<tr ng-repeat="stage in stages">
      <td>{{stage.id_stage}}</td>
      <td>{{stage.number_stage}}</td>
       <td>{{stage.dtSt_begin}}</td>
        <td>{{stage.dtSt_end}}</td>
        <td class="" id="stat">{{stage.status}}</td>
         <td><a data-ng-click="getInfoByStage({{stage.id_stage}})"  href="getStage/{{stage.id_stage}}"   
                                             class="btn btn-primary " role="button" aria-pressed="true">Подробнее</a></td>
                                        
                                        
            
          </tr>


Syntax Error
: Token '{' invalid key at column 17 of the expression [getInfoByStage({{stage.id_stage}})] starting at [{stage.id_stage}}].

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Iralov, 2021-03-02
@kapelka001

Removed the curly braces and everything worked with:

<td><a data-ng-click="getInfoByStage(stage.id_stage)"  href="stage{{stage.id_stage}}"  class="btn btn-primary " role="button" aria-pressed="true">Подробнее</a></td>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question