Frontmatter
| id | 1813 |
| title | model.Component: dynamically adding data props to a model that got defined without data |
| state | Closed |
| labels | enhancement |
| assignees | tobiu |
| createdAt | Apr 19, 2021, 8:45 AM |
| updatedAt | Apr 19, 2021, 8:54 AM |
| githubUrl | https://github.com/neomjs/neo/issues/1813 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Apr 19, 2021, 8:54 AM |

an edge case for sure.
we should use the
constructorto assign an empty object tothis.data.E.g.:
addDataProperty(key, value) { let me = this, data, scope; Neo.ns(key, true, me.data); data = me.getDataScope(key); scope = data.scope; scope[data.key] = value; me.createDataProperties(me.data, 'data'); }The Neo.ns() call would not work in case data is undefined.