# backbone_modal_view

> Backbone + Bootstrap Modal View

Latest version **0.0.3** (published 2017-05-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install backbone_modal_view
pnpm add backbone_modal_view
yarn add backbone_modal_view
bun add backbone_modal_view
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2017-05-25 |
| First published | 2017-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Michael Prather |
| Maintainers | mprather |

## Links

- npm: https://www.npmjs.com/package/backbone_modal_view
- Repository: https://github.com/shintech/backbone_modal_view
- Homepage: https://github.com/shintech/backbone_modal_view#readme
- Issues: https://github.com/shintech/backbone_modal_view/issues
- npm.io page: https://npm.io/package/backbone_modal_view

## Dependencies (1)

- [standard](https://npm.io/package/standard.md) ^10.0.2

## Recent versions

- 0.0.3 (latest) — 2017-05-25
- 0.0.2 — 2017-05-17
- 0.0.1 — 2017-05-17

## README

## Backbone Modal View

### Synopsis

Bootstrap Modal in a Backbone Marionette View

### Usage

#### TableView.js

    import ModelModalView from 'backbone_modal_view'
    
    const modelModalView = new ModelModalView()

    const TableView = Backbone.Marionette.View.extend({
      
      events: {
        'click .table-row': 'handleClick'
      },
    
      initialize: function () {
        modelModalView.template = require('./modal-view-template.html')
      },
    
      handleClick: function (e) {
        const id = $(e.currentTarget).data('id')
        const model = this.collection.get(id)
        
        modelModalView.model = model
        modelModalView.render()
      }
    })

    export default TableView

#### modal-view-template.html

    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h3 class="modal-title"><%= name %></h3>
        </div>
        <div class="modal-body">
          <ul>
            <li><strong>Attribute:</strong> <%- attribute %></li>
            <li><strong>Created At:</strong> <%- created_at %></li>
          </ul>
        </div>
        <div id='task-modal-footer' class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>
    </div>

---
_Source: https://npm.io/package/backbone_modal_view · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
