A
A
Alexander Sharomet2018-05-02 21:56:26
Angular
Alexander Sharomet, 2018-05-02 21:56:26

How to change the class of one component from another in Angular 5?

Let's say I have a navbar.component.ts component with html AND there is a second component aside.component.ts
<nav class='test'>Навигация</nav>

<aside>
<button>Кнопка</button>
</aside>

By clicking on the button in the aside component, the class in the navbar component should change, for example: class test to class test1. These components are neither children nor parent of each other.
The code is optional, just tell me which way to look.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Stolyarov, 2018-05-02
@sharomet

Services

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question