Skip to content
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

workaround for knockout JS creation problem #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

workaround for knockout JS creation problem #130

wants to merge 1 commit into from

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