Updating the template engine
Unfortunately, the ExternalTemplateEngine
we have used until now is not AMD compatible. This is why you should use other solutions. There is a KnockoutJS extension called amd-helpers. You can download it from https://github.com/rniemeyer/knockout-amd-helpers. Ryan Niemeyer is the author of this extension. He is a very famous Knockout developer and has a large following in the Knockout community. He has a blog called Knockmeout (http://knockmeout.net) which has a large number of articles about Knockout and good examples of how the amd-helpers library should be used. In this book, we are just going to use the template engine. But this extension has many other features.
RequireJS just loads JavaScript files natively. To load HTML files asynchronously, download the text extension from https://github.com/requirejs/text and add it to the vendors
folder. With this extension, you can load any kind of file as text.
Now, when we need to load a text file we just need to add...