/** * Created by wisestone on 2018-11-13. */ 'use strict'; define(['app'], function (app) { app.directive('formSubmit', ["$log", "$rootScope", function ($log, $rootScope) { return { restrict : 'A', scope : { makeSearchConditions : "&" }, link : function ($scope, $element, $attrs) { var formName = $attrs["formSubmit"]; // 클릭 $($element).click(function (){ if ($rootScope.isDefined($scope.makeSearchConditions)) { var conditions = $scope.makeSearchConditions(); $("input[name='conditions']").val(JSON.stringify(conditions)); } $('form[name="' + formName + '"]').submit(); }); } }; }]); });