Posts

Showing posts from August, 2016

RequireJS: More with templating - Dynamic data

Find the previous episode here.

Checkout the part 3 branch
git checkout -b part4.0 origin/part4.0
Lets change the templating a bit different so that we could add data to the template. Now if we click on a link other than home everything will be gone.

So we will move the link list to the index before maincontent so that it will always remain there. Next we will replace the modules/home/Home.html with some dummy text.
The index.html wil looks like this
<div>   <ul>     <li><a href="#home">Home</a></li>     <li><a href="#employee">Employees</a></li>     <li><a href="#project">Projects</a></li>   </ul> </div> <div id="maincontent">   </div>
Next we will add some more dummy content to other template html file in projects and employees. And also change the controllers to load and how the content. And also we need to change the router.js like…