ebs.injectStyleAsync
(FintechOS Studio 22.1.4.4 and later)
Loads and applies a custom style sheet. The result of the operation is returned in a void promise object.
Syntax
Copy
function ebs.injectStyleAsync(url: string) : Promise<void>
| Parameter | Type | Description |
|---|---|---|
url
|
string | Path to the style sheet file. |
Response
Returns a void promise object, allowing you to associate handlers in case of success of failure.
Examples
In this example:
- We load the myStyle.css style sheet from the local customOnDemand subfolder.
- If the import is successful, we log the following message: MyStyle injected successfully.
- If the import is not successful, we log the following message: error injecting myStyle.
Copy
ebs.injectStyleAsync("customOnDemand/myStyle.css")
.then(function(){
console.log("myStyle injected successfully");
})
.catch(function(e) {
console.log("error injecting myStyle", e);
})
In this example:
- We load the bootstrap.min.css style sheet from the following URL: https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/.
- If the import is successful, we log the following message: bootstrap css injected successfully.
- If the import is not successful, we log the following message: error injecting.
Copy
ebs.injectStyleAsync("https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css")
.then(function(){
console.log("bootstrap css injected successfully");
})
.catch(function(e) {
console.log("error injecting", e);
})