diff --git a/docs/en/UI/Angular/Internet-Connection-Service.md b/docs/en/UI/Angular/Internet-Connection-Service.md index 4405d6c2c2..aa1f0d6770 100644 --- a/docs/en/UI/Angular/Internet-Connection-Service.md +++ b/docs/en/UI/Angular/Internet-Connection-Service.md @@ -3,15 +3,14 @@ ### internet-connection-service.ts -```js +```ts import { DOCUMENT } from '@angular/common'; import { Injectable, computed, inject, signal } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; @Injectable({ - providedIn: 'root', + providedIn: 'root', }) - export class InternetConnectionService{ protected readonly window = inject(DOCUMENT).defaultView; protected readonly navigator = this.window.navigator; @@ -54,18 +53,18 @@ As you can see from the code above, `InternetConnectionService` is providing 2 a İt's easy just inject the service and get network status **You can get via signal** -```js +```ts class someComponent{ internetConnectionService = inject(InternetConnectionService); isOnline = this.internetConnectionService.networkStatus } ``` **or you can get as observable** -```js +```ts class someComponent{ internetConnectionService = inject(InternetConnectionService); isOnline = this.internetConnectionService.networkStatus$ } ``` -That's all, feel free to try on your template \ No newline at end of file +That's all, feel free to try on your template