A Complete End-to-End Guide for Building Enterprise-Ready Apps
Introduction
Modern web applications are expected to be clean, fast, and visually appealing. Users expect smooth navigation, polished components, responsive layouts, and consistency across screens. For teams building enterprise applications with ASP.NET Core on the backend and Angular on the frontend, Angular Material is one of the most reliable ways to deliver a modern UI without having to design everything from scratch.
The combination of ASP.NET Core and Angular Material provides:
A scalable and secure backend
A refined, modern, consistent frontend
Faster development due to ready-made components
Support for responsive layouts and accessibility
A unified developer experience
This article is a complete guide to integrating Angular Material with an ASP.NET Core + Angular application. We will explain architecture, installation, configuration, UI development, theming, best practices, state management, and production deployment.
This guide is suited for beginner to senior developers.
Understanding the Project Structure
When you create an ASP.NET Core + Angular application using the built-in template:
dotnet new angular -o MyApp
You get the following structure:
MyApp/
├── Controllers/
├── ClientApp/ (Angular project)
├── wwwroot/
├── Program.cs
├── appsettings.json
Key points:
ASP.NET Core hosts the API and also serves compiled Angular files for production
Angular code lives inside ClientApp
Angular Material will be installed inside this ClientApp folder
Installing Angular Material
Move inside the Angular project:
cd ClientApp
Install Angular Material:
ng add @angular/material
This command:
Installs Angular Material and CDK
Sets up animations
Configures a default theme
Updates Angular configuration
Choose options like:
Theme: Indigo/Pink or an enterprise theme
Global typography styles: Yes
Browser animations: Yes
After this, the Angular project is ready for Material integration.
Setting Up Angular Material Modules
Angular Material is modular. Instead of importing the full library, you should import only required components to improve load time.
Create a dedicated Material module:
ClientApp/src/app/material.module.ts
import { NgModule } from '@angular/core';
import { MatToolbarModule } from '@angular/material/toolbar';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatListModule } from '@angular/material/list';
import { MatInputModule } from '@angular/material/input';
import { MatCardModule } from '@angular/material/card';
import { MatTableModule } from '@angular/material/table';
import { MatPaginatorModule } from '@angular/material/paginator';
import { MatSortModule } from '@angular/material/sort';
@NgModule({
exports: [
MatToolbarModule,
MatButtonModule,
MatIconModule,
MatSidenavModule,
MatListModule,
MatInputModule,
MatCardModule,
MatTableModule,
MatPaginatorModule,
MatSortModule
]
})
export class MaterialModule {}
Import this in app.module.ts:
import { MaterialModule } from './material.module';
@NgModule({
imports: [
BrowserModule,
HttpClientModule,
MaterialModule
]
})
export class AppModule { }
This gives the Angular app a consistent UI foundation.
Creating a Material Layout (Toolbar + Sidenav)
Let us create a modern admin layout using Angular Material.
app.component.html
<mat-sidenav-container>
<mat-sidenav #sidenav mode="side" opened>
<mat-nav-list>
<a mat-list-item routerLink="/dashboard">Dashboard</a>
<a mat-list-item routerLink="/customers">Customers</a>
<a mat-list-item routerLink="/reports">Reports</a>
</mat-nav-list>
</mat-sidenav>
<mat-sidenav-content>
<mat-toolbar color="primary">
<button mat-icon-button (click)="sidenav.toggle()">
<mat-icon>menu</mat-icon>
</button>
<span>My Enterprise App</span>
</mat-toolbar>
<div class="content">
<router-outlet></router-outlet>
</div>
</mat-sidenav-content>
</mat-sidenav-container>
Add layout styling:
styles.css
mat-sidenav-container, mat-sidenav-content, mat-sidenav {
height: 100%;
}
.content {
padding: 20px;
}
This gives a standard dashboard layout similar to popular enterprise systems.
Connecting Angular Material UI with ASP.NET Core APIs
Angular Material gives UI components. ASP.NET Core provides APIs. Let us connect them.
Build a Customers API in ASP.NET Core
Controllers/CustomersController.cs
[ApiController]
[Route("api/[controller]")]
public class CustomersController : ControllerBase
{
private static List<Customer> _data = new()
{
new Customer { Id = 1, Name = "Amit Patel", Email = "[email protected]" },
new Customer { Id = 2, Name = "Priya Sharma", Email = "[email protected]" }
};
[HttpGet]
public IActionResult GetAll()
{
return Ok(_data);
}
}
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
}
Run API using:
dotnet run
Fetch Data in Angular
Create service:
ClientApp/src/app/services/customer.service.ts
@Injectable({ providedIn: 'root' })
export class CustomerService {
private baseUrl = '/api/customers';
constructor(private http: HttpClient) {}
getCustomers(): Observable<Customer[]> {
return this.http.get<Customer[]>(this.baseUrl);
}
}
export interface Customer {
id: number;
name: string;
email: string;
}

Join the conversation! Your thoughts help the community grow.