i've been struggling with the simplest thing... i need to add a class to a <div> when i click on, let's say, a button.
I've been looking online and here on stackoverflow for hours and all i can find is some overcomplicated examples with ngFors that i cannot (and i am not able to) deconstruct to fit it to what i need.
I'm looking to achieve something as simple as this (jquery) in angular2/typescript:
$(".button").click(function() {
$(".element").addClass("active");
});
i have a component folder with the usual html,scss, and ts file. this function doesn't need to be global or anything weird.
i can't believe how something as simple as this has become so complicated to achieve with modern frameworks.
any help is greatly appreciated!