title: Trigger functions in different components with a buttonclick via service in Angular?
body: <p>I have a dashboard, where I can type in data in a component and the data is going in a mongoDB. Then I get that data in other components and display it at the same site. Now I just have an update button under each component, that I can manually update every component. But I want to do that in this moment, where I submit my data, that is going to mongodb.</p>
  
  <p>I tried it with a service, but it didn't worked out very well</p>
  
  <p><strong>This should be updated</strong>   </p>
  
  <pre><code>import { UpdateServicenter code heree} from "../../../@core/data/update.service";
  
  constructor(private http: HttpClient, private updateService: UpdateService,) {
                //load it the first time if you refreshing the site
                this.updateOrders();
                //this should call updateOrders again if button is clicked
                this.updateService.updateData()
  }
  
  updateOrders() {
                //here I get the data from mongoDB and set it in my variables
  }
  </code></pre>
  
  <p><strong>Button</strong> (This function is called, if I push the button)</p>
  
  <pre><code>import { UpdateService} from "../../../@core/data/update.service";
  
  constructor(private http: HttpClient,private updateService: UpdateService){}          
  submitButton(){
                this.updateService.updateData()
  }
  </code></pre>
  
  <p><strong>Service</strong></p>
  
  <pre><code>@Injectable()
  
  export class UpdateService {
     updateData(){
          //this should call the function updateOrders()
     }
  }
  </code></pre>
  
  <p>I want to create a service, that can call every function or can be called, if the button is pushed, because I have more than one component which should be updated. </p>