Error creating Singleton instance of sap.ushell.Container in SAPUI5 1.120.12 with TypeScript
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 213
- Forks
- 35
- Avg merge
- 37m
- Merged PRs (30d)
- 1
Description
Hello Experts,
I am encountering an issue with SAPUI5 version 1.120.12 when trying to create a Singleton instance of sap.ushell.Container to get a Navigation Service for navigating to another SAPUI5 application using a semantic object and action.
Problem
The intended method call, as per the API documentation, should be:
sap.ushell.Container.getServiceAsync("Navigation")
However, the linter reports an error, and even the API documentation's recommended approach does not work in TypeScript.
Code Snippet:
sap.ushell.Container.getServiceAsync("Navigation").then(function (navigation) {
navigation.toExternal({
target: {
semanticObject: "SemanticObject",
action: "action"
}
});
});
Linter Error
Additional Information
The issue might be related to an incorrect type definition file, as the method call provided in the API documentation also fails in TypeScript.
How should this method be correctly invoked in TypeScript to avoid the linting error? Could the type definition file for this version be incorrect?
Thank you for your assistance.
Best regards,
Dominik Kastenmeier
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the TypeScript type definition for sap.ushell.Container and compare getServiceAsync("Navigation") with the SAPUI5 API documentation. Reproduce the linter error using the reported call and verify that the corrected invocation supports navigation.toExternal; the issue is done when the documented TypeScript usage passes linting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100