ui5-ts-codegen READMEThis is a Visual Studio Code plugin that generates typescript code for SAPUI5/OpenUI5 model classes. FeaturesGenerate getters/setters and contextPath builders based on the defined data structure of the model. Why generate code?UI5 models has helper functions like setProperty/getProperty to set and get data. However, you would need to know the full data structure of each of your models before you even use it. To make it easier to maintain, this code generator would automatically create the getters and setters for each data on your model. RequirementsThis script expects the following:
Example model class and how it's usedModel class exampleHere's a basic example of a model class that is intended to hold data that will be used on our view:
Using model class in a viewNormally when you work on the view, you need to know the full path of the data that you are binding on the model. But since the auto generated code has created all the functions for us, all possible data will have helper functions to tell the developer the properties that can be bound. Using model class in a controller or any other classSame with views, using model instances in controllers and other classes can be difficult unless the developer knows the entire data structure by heart. The generated code helps this by providing helper getters and setters with the correct data types already pre-filled. Extension SettingsThis extension contributes the following settings:
Known IssuesThis is still a WIP so please let me know if you encounter any issues. Release Notes0.3.2Update readme with samples and use cases 0.3.1Fix issues due to incomplete deployment 0.1Initial release Enjoy! |