How could knockout component register a server rendering page?

53 views
Skip to first unread message

zhu...@thoughtworks.com

unread,
Feb 14, 2017, 1:11:24 AM2/14/17
to KnockoutJS

I've seen Steve Sanderson's video which named Single Page Application with Knockout JS, the project structure is the component contains the HTML and JS View Model are in the same folder, this is easy to register component.

But In my project, I'm using ruby and slim, render the slim file to HTML on the server side, but the javascript is in the front-end, the slim file path is different from the view model path which is in javascript folder.

Michael Best

unread,
Feb 14, 2017, 10:08:14 PM2/14/17
to KnockoutJS
It doesn't matter to Knockout how the Html or JavaScript is formed on the server. You should be able to load Ruby-generated Html the same as static Html. It's just a URL that returns Html from the browser and Knockout's point of view.

-- Michael

zhu...@thoughtworks.com

unread,
Feb 15, 2017, 5:01:34 AM2/15/17
to KnockoutJS
Thank you, It's really helpful. I've solved the problem by inlining the HTML on front-end, it's nothing about server side.
Reply all
Reply to author
Forward
0 new messages