1

I want to access the property in 'selectedCeremonyToUpdate()' observable whose property name is in 'name'. If 'name' contains 'City' then i want

self.edit = function (data, event, name) {
alert("In " + self.selectedCeremonyToUpdate().City());
}

how to do this..

4

1 回答 1

1

您可以使用数组语义按名称访问对象属性。尝试这个:

self.selectedCeremonyToUpdate()[name]()
于 2012-12-27T14:08:25.290 回答