How to use a component from another module in Angular?
Hello everyone! I'm a beginner in Angular and TypeScript, and I have a problem with using a component from another module.
I have two modules: `AppModule` (root) and `SharedModule`. In `SharedModule`, I created a `MyButtonComponent` that I want to use in the template of `AppComponent`, which is located in `AppModule`.
Here is the structure of my project:
**shared.module.ts:**
```typescript
import { NgModule } from '@angular/core';
import { MyButtonComponent } from './my-button.component';
@NgModule({
declarations: [MyButtonComponent],
exports: [MyButtonComponent]
})
export class SharedModule { }
```
**app.module.ts:**
```typescript
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppCom