Is there a way to dynamically modify the changeThis
method by substituting it with the value of a radio element? For example, if I select event1, the method should be switched to Class.event1()
<input
type="radio"
class="radio-input"
id="1"
value="event1"
ng-model="$ctrl.eventType"
ng-change="$ctrl.updateEvent()" />
JavaScript:
updateEvent() {
const getEvent = Class.changeThis({
title: 'Happy Time',
location: 'New York, NY',
description: 'Let\'s go!'
});
}
I attempted this approach:
const getEvent = Class + '.'+ this.eventType({
title: 'Happy Time',
location: 'New York, NY',
description: 'Let\'s go!'
});
}
Nevertheless, it resulted in the error message eventType is not a function
. Even when transformed into a function, the solution still did not work as intended.