You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/architecture/put-business-logic-into-services.md
+22-13Lines changed: 22 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,34 +7,43 @@ title: put business logic into services
7
7
With Angular we are creating applications using a layered architecture. Every layer in our application should have its own responsibility. This means we have decoupled layers and each with its own concern.
8
8
Business logic in our application does not belong in the component layer. The component layer is purely meant to be used for visualization, displaying user interface and handling user input. Therefore, business logic should be extracted into the service layer.
9
9
10
-
# Solution
11
-
12
-
In the following example, we are using the `HttpClient` to fetch data from a backend. This should not be done from the component layer but instead we move the logic into a dedicated service.
10
+
In the following example, we are using the `HttpClient` to fetch data from a backend. This should not be done from the component layer.
0 commit comments