# Angular

Using ActiveJS with Angular doesn't require any special bindings or facade, you can treat ActiveJS as an extension of RxJS, and use it in the same way.

That being said, you should still try to follow the [general guidelines](/activejs/guides/code-style.md) regarding how you structure your code.

In addition to general guidelines, one thing specific to Angular is DI and Services. So. instead of directly exporting the Units and other ActiveJS constructs from a file, you put them in a Service.

Generally, you can keep all the ActiveJS constructs like [Units](/activejs/fundamentals/units.md) and [Streams](/activejs/utilities/stream.md) together in a single Service, but as your App grows larger, it can become a little messy and you might run into cyclic dependencies pretty quickly, in order to avoid that, this is what ActiveJS recommends.

Ideally, you'd have two to three Services, 2 for State Management (ActiveJS) and 1 for general business logic or Angular related logic.

1. `[feature].state.ts`\
   The **FeatureState** Service holds our **state** objects, i.e.: [Units](/activejs/fundamentals/units.md), [Actions](/activejs/fundamentals/action.md), [Systems](/activejs/fundamentals/systems.md), and [Clusters](/activejs/fundamentals/cluster.md).<br>
2. `[feature].streams.ts`\
   The **FeatureStreams** Service contains all the **side-effects** built using [Streams](/activejs/utilities/stream.md) and Angular's `HttpClient`.<br>
3. `[feature].service.ts`\
   The **FeatureService** is an optional Service, which can contain any custom logic depending on your use-case.

For example, if we have a feature called **Auth**, we would create 3 Services like this:

1. `auth.state.ts` **-** with Service name **AuthState**
2. `auth.streams.ts` **-** with Service name **AuthStreams**
3. `auth.service.ts` **-** with Service name **AuthService**

For a complete implementation take a look at the example given in the [AsyncSystem](/activejs/fundamentals/systems/asyncsystem.md).

You can find even more examples in the [Examples](/activejs/more/examples.md) section.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.activejs.dev/activejs/integrations/angular.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
