Helpers for reusable code

So far, each of the pages that we have rendered display their ViewModel data perfectly, but that pesky sidebar still remains blank. We will fix this by creating a few modules for the sidebar content by implementing them as helper modules. These helper modules will be used repeatedly by various parts of our application and don't necessarily belong to the controller folder or the server folder. So, we'll just create a new home called helpers and store these modules there.

As we are just loading temporary fixture data into our ViewModels, the data we set up in the helpers and the controllers will all be replaced with actual live data once we implement MongoDB; we will do this in the next chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.226.120