-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow default model be generated with user having to visit every UI component #21
Comments
@TristanWright Here you go |
Hello, I started experimenting with SimPut in this repository only a couple of days ago as it is part of HPCCloud, which we are examining in order to develop an application. I seem to have come across this issue as well. I created a simple 'contact-card' type as follows. The 'contact-card.hbs' template file is simply the following:
The front-end consists of two simple views where the user can specify his/her First Name and Last Name, as show in the 'model.js' file:
The 'convert.js' file is just:
If the user does not explicitly visit the Last Name view in the front-end, the entry for the Last Name (with the default value of 'Bloggs') does not get created in the viewModel object , causing the convert.js function to fail. Are there plans to create entries for default values in the viewModel? Or is the developer expected to do some sanity checking in the convert.js function? Thanks. |
So far the idea was that the convert.js should contains some sanity check as it can provide a list of error on what could be missing. Also, the convert function can have access to the datamodel as well so the defaults value could be retrieved if needed. |
Ok, fair enough. And thanks for the tip on importing the dataModel into the convert function in order to get access to the defaults. |
Currently you have to visit every component in order to successfully generate a model, it should be possible for a user to just take all the defaults or some of them ...
The text was updated successfully, but these errors were encountered: