I’d to know examples, recommendations and frameworks to start in a right way to refractory a single page web app with html, css and js files (jquery) in a MVC/MVP js application that needs to works in a ie 7 at least (this is mandatory), but if its possible I’d like that this app could works well in others browsers too.
The code is a lot of ifs and else and each one use the document.write() js method to write page elements. To 90’s style yet, like bellow:
if ($auth$ == 19) {
document.write("<TR>");
document.write("<TD NOWRAP WIDTH='100%' height='26'>");
document.write("<font face='Arial, Helvetica'><B>$username$</B> you cannot access your account.<p>Please contact your Security Administrator or Help Desk.</font>");
document.write(" </TD>");
document.write("</TR>");
}
80% percent of this web app is written in this way depends of the external variable values
What are the js modern frameworks or a modern approach that let me able to prototype this in a MVC/MVP js way?
Some references? tutorials?
I’m glad for your help, thanks!
I spent quite a bit of time researching whats available. KnockoutJS has a great tutorial site. Then I found AngularJS which is much more complex because it does so much more. Angular is a full framework to do your routing, databinding (without observables), as well as letting you build your app domain centric by using directives.
Another thing I love about the Angular team is that they are all about testing. They released the Testacular test runner which watches your file system and when any file changes, it runs your unit tests in a browser of your choosing. Automated browser based unit testing, I became hooked pretty quickly.
I have read many people not preferring AngularJS because the there are so many other bits out there that are constantly evolving that are focused on specific aspects of SPA, such as historyJS, backboneJS, sammyJS…Each of these have their own focus and may do the job better. I personally trust AngularJS as its backed by google, and its community is really growing.
John Lindquest has a great set of tutorials he just started recently at egghead.io.
There is a modules community at ngmodules.org which demonstrates the ease of building expansion modules into an angular app.
The youtube page for AngularJS has been very helpful for me to keep up with the suggested structures for your angular app.
I would suggest checking them out. Once you wrap your head around doing it the angular way, you really change your way of thinking.