Giter Site home page Giter Site logo

ui.bootstrap.dragdrop's Introduction

ui.bootstrap.dragdrop

Drag and Drop data and files with a few helpful AngularJS directives.

Usage

Reference the dragDrop.js file.

<script type="text/javascript" src="dragDrop.js"></script>

Add the ui.bootstrap.dragDrop module to your application's module.

angular.module('demo', [
    'ui.bootstrap.dragDrop'
])

Draggable / Droppable

These directives allow data to be bound to draggable elements and dropped into droppable container elements. The drop-model can be a single object or array of objects.

Basic Example

This example shows how having a simple object can be dragged into a collection. The cube's reference is added to the collection, so it is in two places. It can only be dragged once since the collection needs unique object references.

.controller('ExampleController', function ($scope) {
    $scope.cube = { name: 'cube' };
    $scope.shapes = [];
});
<div class="item" draggable drag-model="cube">Cube Object</div>
<div class="drop-area" droppable drop-model="items">
    <div ng-repeat="shape in shapes" ng-bind="shape.name"></div>
</div>
<style>
.item { width: 100px; height: 100px; background: red; }
.drag-area { width: 300px; height: 120px; background: #EEE; }
.drag-area.drag-over { background: green; }
</style>

DragFile / DropFile

The drag-file and drop-file directives allow for quick drag and drop of files to and from the browser.

ui.bootstrap.dragdrop's People

Contributors

templarian avatar

Stargazers

 avatar

Watchers

 avatar  avatar  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.