In my website, I have a simple jade markup as follows:
.well(ng-repeat="note in notes")
.row
h3.pull-left {{note.title}}
p.pull-right ( {{note.subject}}, {{note.college}} )
.row.margin-bottom-10(style="border-bottom: 1px solid #000")
p.pull-left Author: {{note.author}}
p.pull-right Uploaded by: {{note.uploader}}
.row
p.
{{note.description}}
.row
button.btn.btn-default.pull-left(ng-click="download('{{note.noteId}}','all')") Download
button.btn.btn-default.pull-right Details
When this jade markup is converted to HTML in my website, it looks like this:
<div ng-repeat="note in notes" class="well ng-scope">
<div class="row">
<h3 class="pull-left ng-binding">test</h3>
<p class="pull-right ng-binding">( test, MSRIT )</p></div>
<div style="border-bottom: 1px solid #000" class="row margin-bottom-10">
<p class="pull-left ng-binding">Author: test</p>
<p class="pull-right ng-binding">Uploaded by: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fb939a898893928f979a9a9b919b98d8959999">[email protected]</a></p></div>
<div class="row">
<p class="ng-binding">test</p></div>
<div class="row">
<button ng-click="download('5f4815f2-73a9-4621-86ed-b4e302cc49ba','all')" class="btn btn-default pull-left">Download</button>
<button class="btn btn-default pull-right">Details</button></div></div>
It seems that the {{note.noteId}}
is correctly converted to
"5f4815f2-73a9-4621-86ed-b4e302cc49ba"
in the ng-click="download()"
function. However, when I try to use it in my controller like this:
$scope.download = function(noteId,fileId){
var url = '/download/' + noteId + '/' + fileId;
};
I end up with this result:
/download/{{note.noteId}}/all
Instead of the processed value by Angular. How can I fix this issue?