Skip to content

Conversation

@imrefazekas
Copy link
Contributor

Dear Oscar,

I took the liberty to add a new function to the view model: toJSONByPrototype when the method extendWithPage is executed.

This allows one to generate the JS by a model prototype. When I download a data model from server side and create the viewmodel for knockout, I can use this as a "prototype" for JS creation.

This will prevent the knockout to go and touch properties which do not belong to the model.

Considering, that your library must be functional on almost any knockout lib, i post this change here and not to the knockout lib.

@imrefazekas imrefazekas mentioned this pull request Jul 12, 2013
@finnsson
Copy link
Owner

I'm asking on the knockoutjs forum (https://groups.google.com/forum/#!topic/knockoutjs/ezZGzaF233A) what the recommended way forward is.

@imrefazekas
Copy link
Contributor Author

Yep, saw it.
Meanwhile I push requested the code at knockout code repository too. A 'validated' toJS would be needed anyhow for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants