Knockout, then convert to Angular, a bad idea or go straight to Angular

You have a shaving page MVC app. Convert it to use knockout. Then, upon completion, it will return and convert all the knockouts to Angular. I want to get an education on this strategy. Not a matter of pros and cons; I mean, this is inefficient, as rewriting can be harder than if we went straight to Angular. What pitfalls, gotchas, or lessons learned did other people turn knockout into Angular?

+4
source share
1 answer

I did both knockout and angular. It's easier to go from knockout to angular than vice versa. Obviously, the least work will be to move on to the structure / library that you intend to finish.

It’s easier to knock out a razor because it’s just a simple library of bindings, so you can stick with razor routing and replace the razor syntax with a knockout of js files and html. That is, if you do not want to combine knockout with require.js, so that you can serve one html page from your MVC application and consider it as a one-page application. It is also possible.

If you go to a full-fledged SPA, go straight to angular and connect it to ASP.Net Web API 2. Submit one page and then make all subsequent requests return json. You can do this using MVC, but it is better to use Web API 2.

MVC Angular, .

? angular SPA , angular ui-router (2 ), ASP.Net Web API 2.

+3

Source: https://habr.com/ru/post/1650050/


All Articles