Materialize CSS sidenav with Meteor


#1

How do I use the Materialize CSS sidenav with Meteor? When calling $().sidenav() at Template.onRender, the sidenav does not work.

I am using cordova with android/ios.


#2

You should be able to call it with the where .className is the class for the button that is controlling your side navigation.

HTML

<template name="templateName">
 <a href="#" data-activates="slide-out" class="className"><i class="mdi-navigation-menu"></i></a>
</template>

JS

Template.templateName.onRendered(function () {
  $('.className').sideNav({ 
    closeOnClick: true
  });
});

Reference:
http://materializecss.com/side-nav.html