From 6e696a96591c0bbdc1022ef538be16a8e9e549da Mon Sep 17 00:00:00 2001 From: Igor Radovanovic Date: Thu, 21 May 2015 09:24:46 +0200 Subject: [PATCH] Possibility to parse complex data - parseJson . parse json as optional attribute. parsejson="true" --- js/ngPopover.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/ngPopover.js b/js/ngPopover.js index 77b1316..55479b7 100644 --- a/js/ngPopover.js +++ b/js/ngPopover.js @@ -182,10 +182,11 @@ module.provider('ngPopover', function () { var useParentWidth = options.useparentwidth || false; var anchorSelector = options.anchorselector || ''; var maxWidth = options.maxwidth || null; + var parsejson = options.parsejson || false; if (options.data) { scope = scope.$new(); - scope.rrData = options.data; + scope.rrData = parsejson ? JSON.parse(options.data) : options.data; } var setupClick = function() { @@ -271,4 +272,4 @@ module.directive('ngPopover', ['ngPopover', function(ngPopover) { } } -}]); \ No newline at end of file +}]);