Is there a way to set the page title by data-binding using Knockout.js?

前端 未结 5 1061
春和景丽
春和景丽 2020-12-11 00:05

I have a viewModel with a Title property. I\'d like to set the page title using that property. Here\'s what I tried already, which didn\'t work:



        
5条回答
  •  -上瘾入骨i
    2020-12-11 00:37

    You could create a custom binding handler which sets document.title on update, then add the binding to the body element.

提交回复
热议问题