Skip to content

williamledoux/meteor-bootstrap-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meteor BootstrapToggle v2.2.1

Meteor client-side component that maps a BoostrapToggle (v2.2.1) to a Session var. The binding is bi-directionnal, so if the Session var is updated, the component will change, and if the component is clicked, the Session var will get updated as well.

Usage

    <template name="toggles">
        {{> BootstrapToggle options=toggle_A_options var="A"}}
        {{> BootstrapToggle options=toggle_B_options var="B"}}
    </template>
    if (Meteor.isClient){
        Session.set("A", true);
        Session.set("B", false);

        Template.toggles.helpers({
            "toggle_A_options": function(){
                return {
                    "size": "small"
                }
            },
            "toggle_B_options": function(){
                return {
                    "onstyle" : "success",
                    "offstyle": "danger"
                };
            }
        });
    }

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published