GithubHelp home page GithubHelp logo

ko-modal-util's Introduction

Knockout Bootstrap Modal Utility

A modal utility to make using and navigating bootstrap modals easier.

Getting Started

If you have included the ko-modal-util script on your page you already have an instance of the modal controller at ko.Modal. Note: to use this script you must have bootstrap and knockout included before ko-modal-util[.min].js.

Show

Once there show a modal by supplying an object containing the following options

ko.Modal.show({
  template: (required),
  [title]: (optional),  
  [model]: (optional according to template bindings),  
}, [callback]);

Hide

ko.Modal.hide([callback]);

Example

<button id="basic-modal-launch" class="btn btn-primary">Launch Modal</button>
<script id="basic-modal-template" type="text/html">
  <p>Here is a sample modal launched from the modal utility controller....</p>
</script>
$(document).ready(function() {
  
  
  $('#basic-modal-launch').click(function() {
    ko.Modal.show({
      title: 'Basic Modal',
      template: 'basic-modal-template'
    });
  });
});

Developers

Before developing or running the examples be sure to have the following installed:

Then pull down dependencies by running the following commands:

npm install

Once installed you may run the example/test server and build your resources with:

npm start

ko-modal-util's People

Contributors

jaekschmitt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.