Skip to content

Instantly share code, notes, and snippets.

@seanbollin
Created April 24, 2014 00:23
Show Gist options
  • Save seanbollin/11237180 to your computer and use it in GitHub Desktop.
Save seanbollin/11237180 to your computer and use it in GitHub Desktop.
<hive-validator></hive-validator>
(hive-validator.html): <div drop-target></div>
angular.module('amperApp.directives')
.directive('hiveValidator', ['hiveQueryService', function(hiveQueryService) {
return {
restrict: 'E',
templateUrl: 'partials/jobs/hive-validator.html',
replace: true,
link: function($scope, element, attrs) {
.directive('dropTarget', ['utilsService', function(utils) {
var getData = function(event) {
return JSON.parse(event.originalEvent.dataTransfer.getData('text'));
};
return {
restrict: 'A',
scope: true,
link: function($scope, element, attrs) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment