})
crmMailingAB.controller('TabsDemoCtrl', function ($scope, crmApi,selectedABTest) {
$scope.abId="";
+ $scope.whatnext=2;
$scope.currentABTest=selectedABTest
$scope.groups = CRM.crmMailing.groupNames;
$scope.mailList = CRM.crmMailing.civiMails;
console.log($scope.currentABTest.mailing_id_a);
$scope.abId = $scope.currentABTest.id;
- $scope.mailA = crmApi('Mailing','getsingle',{id:$scope.currentABTest.mailing_id_a});
- $scope.mailB= crmApi('Mailing','getsingle',{id:$scope.currentABTest.mailing_id_b});
- console.log($scope.mailA);
+ var abmailA = crmApi('Mailing','getsingle',{id:$scope.currentABTest.mailing_id_a});
+ var abmailB= crmApi('Mailing','getsingle',{id:$scope.currentABTest.mailing_id_b});
+ abmailA.success(function (data) {
+ if (data.is_error == 0) {
+ $scope.mailA = data;
+
+ };
+ });
+ abmailB.success(function(data) {
+ if (data.is_error == 0) {
+ $scope.mailB = data;
+
+ };
+ });
}
else{
console.log("Prithvila");
<h3> What would you like to test ?</h3><br><br>
-   <input type="radio" ng-model="template" ng-value="templates[0]" ng-init="whatnext=2"> Subject Lines <br/><br>
-   <input type="radio" ng-model="template" ng-value="templates[1]" ng-init="whatnext=3"> From Names <br/><br>
-   <input type="radio" ng-model="template" ng-value="templates[2]" ng-init="whatnext=1"> Two different Emails <br/><br>
+   <input type="radio" ng-model="template" ng-value="templates[0]" ng-click="init(2)"> Subject Lines <br/><br>
+   <input type="radio" ng-model="template" ng-value="templates[1]" ng-click="init(3)"> From Names <br/><br>
+   <input type="radio" ng-model="template" ng-value="templates[2]" ng-click="init(1)"> Two different Emails <br/><br>
 
<div style="position:relative; left:220px; top: 30px;" nextbutton></div>
<div style="position:relative; left:300px; top:-1px;" cancelbutton></div>
<div id="tabs-2">
<form>
- <div ng-include="template.url"> -->
+ <div ng-include="template.url">
+
</div>
<div style="position:relative; left:200px; top:61px;" prevbutton></div>
<div style="position:relative; left:300px; top: 30px;" submitform nextbutton></div>
<div id="tabs-21">
<div>
- {{mailA}}
+
<table class="form-layout-compressed">
<tr>
<td class="label">From E-mail Address</td>
<td>
- {{mailA.subject}}
+
<select style="width: 200px" ng-model="mailA.from_email" ng-options="frm.email as frm.email for frm in eMailing">
<option value="">-none-</option>
</select>