Reputation: 2162
It is simple to write data-bind expression like:
<span data-bind="text: userName"></span>
But I want to include Hello before userName so the span should look like:
Hello World
where World is userName
How can I write this in data binding expression?
Note: Please do not suggest that I move Hello out of span and write it statically :)
Upvotes: 0
Views: 113
Reputation: 887215
Knockout can bind expressions too:
<span data-bind="text: 'hello ' + userName()"></span>
Upvotes: 1