Hint: you probably need a route oriented approach. The other is for the sake of completeness.
Viewmodel oriented approach
, : , . clickedElementId , ( , , ). , , () , , . , " ", , ( ).
,
, , , . () . , , "details/: id" ( id, ) "details (/: id)" ( id, ).
:
overview.onElementClick = function (e) {
var element = this,
koDataForElement = ko.dataFor(element);
router.navigate('details/' + koDataForElement.id);
}
ko.dataFor - , viewmodel, , , . clicked . .
viewmodel :
details.activate = function (id) {
};
: : . , , - :
<div data-bind="foreach: myListOfElements">
<a href="#" data-bind="attr: { href: '#details/' + id }">listElementGoesHere</a>
</div>
! , ,