Skip to content

Commit

Permalink
Merge branch 'issue/17854' of https://github.com/abpframework/abp int…
Browse files Browse the repository at this point in the history
…o issue/17854
  • Loading branch information
mahmut-gundogdu committed Oct 12, 2023
2 parents 6a5f08a + 213fd62 commit c92155c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/en/UI/Angular/Abp-Window-Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
## Download Blob as File
AbpWindowService is an Angular service designed to provide utility methods related to window operations. The service has a `downloadBlob` function, which is used for downloading blobs as files within the context of a web application.

## Usage
### Usage

To make use of the FileUtilsService in your Angular application, follow the steps below:

Injection:
### Injection
Firstly, ensure that the service is injected into the component or any other Angular entity where you wish to use it.

```js
Expand All @@ -19,7 +19,7 @@ constructor(private abpWindowService: AbpWindowService) { }
// private abpWindowService = inject(AbpWindowService)
```

Downloading a Blob:
### Downloading a Blob

Once you have the service injected, you can use the downloadBlob method to initiate the download of blob data as a file. For instance:

Expand All @@ -30,11 +30,11 @@ someMethod() {
}
```

Permissions & Considerations:
### Permissions & Considerations

Ensure that you have appropriate permissions and user interactions before triggering a download. Since downloadBlob initiates a download programmatically, it's best to tie this action to direct user interactions, such as button clicks, to prevent unexpected behaviors or browser restrictions.


### DOCUMENT Token in Service

Angular, being a platform-agnostic framework, is designed to support not only browser-based applications but also other environments like server-side rendering (SSR) through Angular Universal. This design philosophy introduces challenges when accessing global browser-specific objects like window or document directly. To address this, Angular provides a DOCUMENT token that can be used to inject the document object into Angular entities like components and services.
Angular, being a platform-agnostic framework, is designed to support not only browser-based applications but also other environments like server-side rendering (SSR) through Angular Universal. This design philosophy introduces challenges when accessing global browser-specific objects like window or document directly. To address this, Angular provides a DOCUMENT token that can be used to inject the document object into Angular entities like components and services.

0 comments on commit c92155c

Please sign in to comment.