---
title: Override TypeScript controllers per theme
slug: configured-commerce/docs/how-to-override-typescript-controllers-per-theme-in-classic
createdAt: 2026-08-13T10:46:25.000Z
---

:::hint{type="warning"}
**Important**

Classic CMS reached end-of-life in January 2025 and is no longer receiving feature updates or bug fixes. You should \[migrate to Spire CMS]\(../../End user docs/spire-cms/get-started-with-spire-cms/migrate-from-classic-cms-to-spire-cms.mdx).
:::

Based on the theme you are in, this article provides the necessary steps to override the TypeScript Controllers. You can override the **Standard Controller** with a controller that selects the controller for the theme you are in. Then, in the init method of the "contain and delegate" controller you can get the injector:

```typescript
const injector = angular.element(document.body).injector();
```

and then say, if theme is **InsiteCustom**, use the injector to get the **InsiteCustom** version of the controller:

```typescript
this.delegateToController = injector.get("InsiteCustomController"); 
else 
this.delegateToController = injector.get("InsiteStandardController");
```

In your "contain and delegate" controller you override all the standard methods and delegate the calls to the `this.delegateToController` methods.
