I created a class to manage the main UI interactions with my app. In the constructor, I'd like to wire up the click event for the nav li's. Can someone help me figure out how to scope these objects correctly?
class app {
constructor() {
$('.nav li').on("click", function() {
// I want to call changeView but pass in the data attribute from the li as the view param
// ex. changeView($(this).data('view'));
});
}
changeView(view) {
console.log(view);
}
}