javascript - Using angular expression in html onclick attribute -


i using angular build table me dynamically. expression user.user.id needs listed out integer in each place use , works everywhere except inside html script tag using. there throws error in javascript. i'm sure there better way i'm doing here, i'm looking quick , simple solution display user id can referenced script tag.

here code:

 <table class="table" ng-hide="loading" >          <tr>             <th>test search code</th>             <th>test current company</th>             <th>name</th>             <th>email</th>             <th>created</th>             <th></th>         </tr>          <tr ng-repeat="user in users | filter:searchtext ">             <!-- these references work fine -->             <td>{{user.user.mapped_test_search_code}}</td>             <td>{{user.employment[0].name}}</td>             <td>{{user.user.mapped_first_name}}</td>             <td>{{user.user.mapped_email}}</td>             <td>{{user.user.created}}</td>             <td><a href="/admin/mapped_users/edit/{{user.user.id}}"><span class="glyphicon glyphicon-pencil"></span></a></td>              <td>                  <!-- 1 works too-->                 <form action="{{'/admin/users/delete/' + user.user.id}}" name="post_{{user.user.id}}" id="post_{{user.user.id}}" style="display:none;" method="post" class="ng-pristine ng-valid">                     <input type="hidden" name="_method" value="post">                 </form>                  <!-- 1 in tag, in script attribute not work -->                 <a href="#" class="btn btn-block" onclick="if (confirm(&quot;are sure?&quot;)) { document[ 'post_' + user.                 user.id ].submit(); } event.returnvalue = false; return false;" original-title="">                     <span class="glyphicon glyphicon-trash"></span>                 </a>              </td>          </tr>      </table> 


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -