diff --git a/bower.json b/bower.json index 70d5a89..2641667 100644 --- a/bower.json +++ b/bower.json @@ -12,6 +12,7 @@ ], "main": [ "js/ngPopover.js", + "js/ngPopover.min.js", "css/ngPopover.css" ], "license": "MIT", diff --git a/js/ngPopover.js b/js/ngPopover.js index 77b1316..c301fe3 100644 --- a/js/ngPopover.js +++ b/js/ngPopover.js @@ -1,6 +1,6 @@ -var module = angular.module('ngPopover', []); +angular.module('ngPopover', []) -module.provider('ngPopover', function () { +.provider('ngPopover', function () { var open = false; var smallScreenBreakpoint = 500; @@ -176,17 +176,22 @@ module.provider('ngPopover', function () { if (!template) { template = options.template || options.ngPopover; } - var placement = options.placement || 'bottom'; - var maximize = options.maximize || false; - var title = options.title || ''; - var useParentWidth = options.useparentwidth || false; - var anchorSelector = options.anchorselector || ''; - var maxWidth = options.maxwidth || null; - - if (options.data) { - scope = scope.$new(); - scope.rrData = options.data; - } + var placement = options.placement || 'bottom'; + var maximize = options.maximize || false; + var title = options.title || ''; + var useParentWidth = options.useparentwidth || false; + var anchorSelector = options.anchorselector || ''; + var maxWidth = options.maxwidth || null; + var evalEl = options.evalEl || false; + + if (options.data) { + scope = scope.$new(); + if(evalEl){ + scope.rrData = evalEl=='parent' ? scope.$parent.$eval(options.data) : scope.$eval(options.data); + }else{ + scope.rrData = options.data; + } + } var setupClick = function() { $('body').append("