Posts

Showing posts from April, 2025

Module Federation with Angular: Sharing service from Shell to Remote

Image
 For the project setup refer:   app Let's say i have shell and remote right now With Module federation installed And Also angular.json updated  shellserv.service.ts import { Injectable } from '@angular/core' ; @Injectable ({ providedIn : 'root' // Ensure the service is available globally }) export class ShellService { constructor () { } sayHello () { return "hello from Shell!!" } } Make sure this works in shell app first import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core' ; import { provideRouter } from '@angular/router' ; import { routes } from './app.routes' ; import {ShellService} from './shellserv.service' ; export const appConfig : ApplicationConfig = { providers : [ provideZoneChangeDetection ({ eventCoalescing : true }), provideRouter ( routes ), ShellService] }; import { Component } from '@angular/core' ; import { RouterOutlet } from '@angular/router' ; impo...