Reputation: 77
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..
Upvotes: 1
Views: 199
Reputation: 7194
You can access object properties by name using array semantics. Try this:
self.selectedCeremonyToUpdate()[name]()
Upvotes: 1