简体   繁体   中英

How to concatenate two params using href?

I have kendo grid where i am using anchor tag so using href i am trying to pass two params from client side but it always give syntax error, any help what is correct way to pass variables using href.

config.js

toolbar: [{template: '<a class="btn btn-default btn-sm pull-right"  
      href="app/challenge/rest/exportChallengeGridDataToExcel?key={{$rootScope.id}}  
        &challengeType={{$rootScope.challengeType}}">Export to Excel</a>'}]

You can do something like :

'<a class="btn btn-default btn-sm pull-right"  
href="app/challenge/rest/exportChallengeGridDataToExcel?key={{$rootScope.id}}  
&challengeType={{$rootScope.challengeType}}">Export to Excel</a>

Anyways I would encourage you to use $rootScope as less as possible, also to build your URL in your controller so your html looks more readable, but that's up to you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM