Working a new project using Knockout, the base documentation didn't seem to explain a case as below. Using the below attr calling; An incorrect href is produced: "api/degrees/function c(){if(0"
<a data-bind="attr: { href: '/api/degrees/' + fieldId }">
Although the following produces the fieldId value correctly
<a data-bind="attr: { href: fieldId }">
Is the only way to successfully combine the base url string and JS object value to use a Knockout computed value?
Thanks in advance for the help.
Try:
<a data-bind="attr: { href: '/api/degrees/' + fieldId() }">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With