### Start UI5 Development Server Source: https://github.com/ui5/docs/blob/main/docs/03_Get-Started/step-1-hello-world-typescript-c20489e.md Starts the local web server to host the UI5 application and opens it in the browser. ```bash npm start ``` -------------------------------- ### Configure package.json Start Script Source: https://github.com/ui5/docs/blob/main/docs/03_Get-Started/step-26-mock-server-configuration-bae9d90.md Adjusts the 'start' script in package.json to open 'mockServer.html' instead of 'index.html'. This facilitates easier local development by defaulting to the mock server. ```json { "name": "ui5.walkthrough", "version": "1.0.0", "description": "The UI5 walkthrough application", "scripts": { "start": "ui5 serve -o test/mockServer.html" }, "devDependencies": { "@ui5/cli": "^3", "ui5-middleware-simpleproxy": "^3" } } ``` -------------------------------- ### Project dependencies example Source: https://github.com/ui5/docs/blob/main/docs/04_Essentials/using-web-components-1c80793.md Example of how UI5 Web Components packages appear in your project's package.json dependencies. ```json "dependencies": { ... "@ui5/webcomponents": "^2.9.0", "@ui5/webcomponents-ai": "^2.9.0", ... } ``` -------------------------------- ### Start UIComponent for OPA5 Tests Source: https://github.com/ui5/docs/blob/main/docs/04_Essentials/getting-started-with-opa5-22f175e.md Initiate OPA5 tests by starting a UIComponent. Provide the component configuration, including its name. This approach is faster and easier for debugging than using iframes. ```javascript // "Opa5" required from "sap/ui/test/Opa5" new Opa5().iStartMyUIComponent({ componentConfig: { name: "samples.components.button" } }); ``` -------------------------------- ### Install UI5 CLI Source: https://github.com/ui5/docs/blob/main/docs/03_Get-Started/step-1-hello-world-typescript-c20489e.md Installs the UI5 Command Line Interface as a development dependency for the project. ```bash npm install --save-dev @ui5/cli ``` -------------------------------- ### Start OData V2 Mock Server Source: https://github.com/ui5/docs/blob/main/docs/04_Essentials/cookbook-for-testing-controls-with-qunit-0ddcc60.md Configures and starts the OData V2 mock server. Ensure the mock server is set up and destroyed within your test. ```javascript // "MockServer" required from module "sap/ui/core/util/MockServer" function startMockServer(iRespondAfter) { // configure respond to requests delay MockServer.config({ autoRespond : true, autoRespondAfter : iRespondAfter || 10 }); // create mockserver const oMockServer = new MockServer({ rootUri : "http://sap.com/service/" }); // start and return oMockServer.simulate("data/metadata.xml", "data"); oMockServer.start(); return oMockServer; } //Your test: QUnit.test("Should do something with the model", function (assert) { //Arrange const oMockServer = startMockServer(0); // System under Test + Act //Cleanup oMockServer.stop(); }); ``` -------------------------------- ### Arrangement: Starting the Application Source: https://github.com/ui5/docs/blob/main/docs/04_Essentials/getting-started-with-opa5-22f175e.md Defines the arrangement for an OPA5 test by starting the application in an iframe. Assumes the app is located at '../index.html' relative to the test file. ```javascript // "Opa5" required from "sap/ui/test/Opa5" var arrangements = new Opa5({ iStartMyApp : function () { return this.iStartMyAppInAFrame("../index.html"); } }); ``` -------------------------------- ### Absolute Binding Path Examples Source: https://github.com/ui5/docs/blob/main/docs/04_Essentials/binding-path-2888af4.md These examples demonstrate absolute binding paths, which start with a slash and are resolved from the root of the model. ```plaintext '/Products/0/ProductName' ``` ```plaintext '/Products(0)/ProductName' ``` ```plaintext 'ProductName' ``` -------------------------------- ### Example Rule ID Format Source: https://github.com/ui5/docs/blob/main/docs/04_Essentials/guidelines-and-best-practices-eaeea19.md Rule IDs should follow CamelCase and start with small caps. ```text hardcodedTextValues ``` -------------------------------- ### HTML Setup for Instantiating Controller and XML View Source: https://github.com/ui5/docs/blob/main/docs/04_Essentials/example-js-fragments-used-in-xml-views-faaff35.md Provides the HTML structure to bootstrap the SAPUI5 core, load necessary libraries (`sap.m`, `sap.ui.layout`), and set resource roots. It then uses `sap.ui.require` to load the controller and XML view, instantiates them, and places the view onto the page. ```html JSFragment used in XmlView
``` -------------------------------- ### Get FileSizeFormat Instance Source: https://github.com/ui5/docs/blob/main/docs/04_Essentials/file-size-format-24f340b.md Instantiate FileSizeFormat using the static getter method. No specific setup is required for basic usage. ```javascript var oFileSizeFormat = sap.ui.core.format.FileSizeFormat.getInstance(); ``` -------------------------------- ### Accessing Associations Source: https://github.com/ui5/docs/blob/main/docs/07_Developing_Controls/writing-a-control-renderer-91f3939.md Provides an example of accessing an association of a control, which links to another control. This snippet shows how to get the 'labelFor' association. ```javascript var sAssociatedControlId = oControl.getLabelFor(); ``` -------------------------------- ### Using Core.ready() as a Promise Source: https://github.com/ui5/docs/blob/main/docs/04_Essentials/deprecated-core-api-798dd9a.md Demonstrates how to use the Core.ready() function as a Promise for chaining asynchronous operations or awaiting the Core's ready state. This is the recommended alternative to attachInit. ```javascript sap.ui.require(["sap/ui/core/Core"], async function(Core) { Core.ready(() => { // this callback is executed directly in case the Core is // already in ready state, otherwise it is executed at a later point in time }); // You can also use the ready() function as a Promise, e.g. Core.ready().then(...) // or await it await Core.ready(); }); ``` -------------------------------- ### Get All Analysis History Source: https://github.com/ui5/docs/blob/main/docs/04_Essentials/support-assistant-api-a34eb58.md Call this method to retrieve all recorded analysis history objects. No specific setup is required beyond having analysis data available. ```javascript RuleAnalyzer.getAnalysisHistory() ``` -------------------------------- ### Autostart Configuration Source: https://github.com/ui5/docs/blob/main/docs/04_Essentials/configuration-options-738ed02.md Determines whether the test starter should automatically call `QUnit.start()` after all prerequisites are met. Prerequisites include loading QUnit, Sinon, the bridge, coverage tooling, and executing test modules. ```javascript autostart: true ``` -------------------------------- ### HTML Entry Point (index.html) Source: https://github.com/ui5/docs/blob/main/docs/03_Get-Started/step-1-no-data-binding-4cde849.md The main HTML file that bootstraps the UI5 core, configures the application, and defines the component to be loaded. ```html Data Binding Tutorial
``` -------------------------------- ### Correct Button Tag in XML Source: https://github.com/ui5/docs/blob/main/docs/03_Get-Started/an-empty-page-comes-up-51fe8f4.md Control tags in XML views must start with capital letters. This example shows the correct capitalization for a Button control. ```xml