Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 30, 2013 05:27 PM by myddoc
Jan 26, 2013 07:03 AM|LINK
My team need to developp a mobile website with an administration part.
I would like to work a layer based on webAPi with knockout.js in the design layer. Nevertheless after to use it a little time, I encountered several
second one, I try to access to data from object build like that : object A -> property List<Object B> -> property Title and property Description, I need to use a compute method to permit to display on the same line Title and Description, but i dont find
an easy way so for the moment it's like below. It's complicate, if I need to search a long time to find how to add a compute on the list News, it's not the right technical solution.
<ul id="update-News" data-bind="foreach: $data.News">
<p data-bind="text : $data.Title"></p>
<p data-bind="text : $data.Description"></p>
Third one :
I need to learn lockout.js and I have the impression it take a long time and maybe I will encountered some weird behavior.
So my conclusion is lockout.js is not the right solution,
For the backoffice: 70% from the duration/tasks
I think to write controllers inherit from ApiController.
Between The design and ApiController I build some classes inherit from Controller.
I use the generation View and controller from ASP.NET MVC4 without to use knockout.js.
For the frontend: 30% from the duration/tasks
Try to implement lockout.js and call directly webapi build in the backend.
What is your opinion or point of view regarding your recently projects?
Jan 26, 2013 09:05 PM|LINK
Is someone can share his experience by using knockout js?
Jan 28, 2013 12:50 PM|LINK
Blogged it about yesterday: My experiences with Knockout
We are using Knockout successfully with WCF and JsonResult. It is also easy to use knockout with Web API as it is p to you how you retrieve data and serve it to Knockout. Knockout is not about reading and saving data - it is about implementing MVVM pattern
on user-interface side.
If my blog post leaves questions up then please feel free to ask more :)
Jan 28, 2013 06:13 PM|LINK
Thank for your answer.
I agree with you about what is supposed to do Knockout. I am not convince it should be used because you need to duplicate the object from the server on the client side and the time to learn is more long.
Exemple I have a class user with a property List<News>
I found many samples about how to use the ko.computed on the self object but when you decide to customize the behavior for an element as List<News> for each elements returned, it's not simple. I don't find an easy to show two properties from news.
I notice when an issue, I don't find a clear issue throwed by Knockout.js
BUT regarding your answer, I supposed I don't pass enough time to work on it, so for the current project we try to use it.
Jan 28, 2013 06:19 PM|LINK
Knockout has some overhead to coding, of course. You have to create view models and if needed you have to modify objects you get from web server (like making some properties observable or add new properties). I think other frameworks like this have same
Knockout takes some time to get used with it. As a server-side guy for me it was damn kinky at first place. But I went with it, I ran into troubles, I solved the problems and after some weeks I was able to write working code on it with no markable issues.
So be prepared for some difficulties. Later it saves you hell load of time you otherwise spend on inventing the same wheel but painful way.
Jan 30, 2013 05:27 PM|LINK
Thank you really for your experience, so it possible to use Jquery UI and Lockout very easy after to have enough XP, a good sound.