Reputation: 2757
Upon request I render a jade template passing some parameters to template
res.render("result.jade",{order_id: "abc123"});
What is the best way to bind this passed parameters to scope variables when being rendered on client side? I haven't found any good solution except to render it to some hidden dom element and then take its text value (with jquery, for example) and assign it to scope variable, like this
// jade template
div.hidden #{order_id}
// javascript code
$scope.order_id = $(".hidden").text();
Upvotes: 1
Views: 247
Reputation: 10145
I would recommend you make this data available as a separate API call, such as REST. Then your Angular app would call this API to get the data on load, etc.
Upvotes: 1