Change sample language in docs

pull/17054/head
Masum ULU 2 years ago committed by Mahmut Gundogdu
parent 89e683f83a
commit 64ee7ce750

@ -3,7 +3,7 @@
### internet-connection-service.ts
```js
```ts
import { DOCUMENT } from '@angular/common';
import { Injectable, computed, inject, signal } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
@ -11,7 +11,6 @@ import { BehaviorSubject } from 'rxjs';
@Injectable({
providedIn: 'root',
})
export class InternetConnectionService{
protected readonly window = inject(DOCUMENT).defaultView;
protected readonly navigator = this.window.navigator;
@ -54,14 +53,14 @@ 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$

Loading…
Cancel
Save