I am migrating an AngularJS app to Angular 2+. How should I implement the below code in Angular 2+ in order to add or remove CSS classes to the DOM:
link(scope, element, attrs) {
let app = angular.element(document.querySelector('#app'))
element.on('click', (event) => {
if (app.hasClass('nav-collapsed-min')) {
app.removeClass('nav-collapsed-min')
this.collapseService.notify(false)
} else {
app.addClass('nav-collapsed-min')
this.collapseService.notify(true)
}
return event.preventDefault()
})
}