I am using backbone marionette with handlebars.js and require.js. So I know how to use templates if we don't have to supply anty dynamic value.
But now I have to show a list of employees using CollectionView of marionette framework So now I am not able to understand how to use handlebar to supply dynamic data into Collection View.
This is my view
ContactManager.module('ContactsApp.List', function(List, ContactManager,
Backbone, Marionette, $, _) {
List.Contact = Marionette.ItemView.extend({
tagName : "li",
template : Handlebars.compile(EmployeeTemplate)
});
List.Contacts = Marionette.CollectionView.extend({
tagName : "ul",
itemView : List.Contact
});
});
This is the template
<label><%= firstName %> <%= lastName %> </label>
How to supply these parameters dynamically to the CollectionView?