preview working
authoraditya-nambiar <aditya.nambiar007@gmail.com>
Sat, 9 Aug 2014 05:20:19 +0000 (10:50 +0530)
committeraditya-nambiar <aditya.nambiar007@gmail.com>
Sat, 9 Aug 2014 05:20:19 +0000 (10:50 +0530)
js/angular-crmMailingAB.js
partials/abtesting/main.html

index fe37d3f9a68b31f5f2cd91000c3b147d3ec25a8a..68cf7f5b9aad15be04dd93d1120e6b95b8f6bf7a 100644 (file)
 
 
   })
-  crmMailingAB.controller('TabsDemoCtrl', function ($scope, crmApi,selectedABTest) {
+  crmMailingAB.controller('TabsDemoCtrl', function ($scope, crmApi,selectedABTest,$sce) {
     $scope.abId="";
     $scope.whatnext=2;
     $scope.currentABTest=selectedABTest
     }
 
     mltokens = CRM.crmMailing.mailTokens;
+    $scope.deliberatelyTrustDangerousSnippeta = function() {
+      return $sce.trustAsHtml($scope.previewa);
+    };
+
+    $scope.deliberatelyTrustDangerousSnippetb = function() {
+      return $sce.trustAsHtml($scope.previewb);
+    };
 
     $scope.tab_val = 0;
     $scope.max_tab = 0;
 
           $scope.previewa=data.values.html;
 
-          $scope.prea='I am an <code>HTML</code>string with ' +
-            '<a href="#">links!</a> and other <em>stuff</em>';
-
-          //$scope.previewa1=$scope.previewa.substring(3935);
-          //$scope.previewa1='<style>'+$scope.previewa.substring(0,3935)+'</style>'+$scope.previewa.substring(3935);
-          $scope.previewa1= '<style type="text/css">color: blue;</style><div>gfgfdgdfgdgdf</div>'
 
 
         }
           console.log(data.values.html);
           $scope.previewb=data.values.html;
 
-          $scope.previewb1=$scope.previewb.substring(3935);
-
-          $scope.$apply();
 
         }
       });
index c287fc1abc65b5755abd1a16e5e202c0b34c19a2..11b2dcbcf308110eebeb90a7cde06bd9cbd6dc9e 100644 (file)
@@ -3,7 +3,6 @@
   {{currentABTest.mailing_id_b}}<br>
   {{currentABTest.mailing_id_a}}<br>
 
-{{previewa1}}<br>
   <div ui-jq="tabs" id="alltabs">
     <ul>
 
             </li>
 
           </ul>
-          <div id="frag1" ng-bind-html="previewa1" >
+          <div id="frag1" ng-bind-html="deliberatelyTrustDangerousSnippeta()" >
 
           </div>
-          <div id="frag2" ng-bind-html="previewb1">
+          <div id="frag2" ng-bind-html="deliberatelyTrustDangerousSnippetb()">
 
           </div>