From: aditya-nambiar Date: Mon, 16 Jun 2014 20:47:12 +0000 (-0400) Subject: Groups API used X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b10d4274daabb51b7116b5b2a096400825b08709;p=civicrm-core.git Groups API used --- diff --git a/js/angular-crmMailingAB.js b/js/angular-crmMailingAB.js index 609f3100c9..332d5a4149 100644 --- a/js/angular-crmMailingAB.js +++ b/js/angular-crmMailingAB.js @@ -31,25 +31,29 @@ templateUrl: partialUrl('helloworld.html'), controller: 'TabsDemoCtrl', resolve: { + metaData: function($route, crmApi) { + return crmApi('Group', 'get', {}); + }, mailingList: function($route, crmApi) { return crmApi('Mailing', 'get', {}); - }, - allgroups: function($route,crmApi){ - return crmApi('Group','get',{}); } } }); + + } ]); //----------------------------------------- // Add a new record by name. // Ex: - crmMailingAB.controller('TabsDemoCtrl', function($scope, crmApi, mailingList) { + crmMailingAB.controller('TabsDemoCtrl', function($scope, crmApi, metaData, mailingList) { + $scope.groups = metaData.values; + $scope.mailings = mailingList.values; $scope.adi=0; $scope.campaign_clicked= function(){ if($scope.adi >= 0 ){ @@ -133,9 +137,11 @@ link: function(scope,element, attrs){ - $(document).ready(function() { $(element).select2({width:"400px",placeholder: "Select the groups you wish to include"}); + $(element).select2({width:"400px",placeholder: "Select the groups you wish to include"}); + $(element).select2("data",groups) + + - }); } }; diff --git a/partials/abtesting/helloworld.html b/partials/abtesting/helloworld.html index 3da00ae097..d9eed593ce 100644 --- a/partials/abtesting/helloworld.html +++ b/partials/abtesting/helloworld.html @@ -5,9 +5,11 @@ + -
    @@ -54,12 +56,9 @@

    Select the groups you would like to add


    -   + +

    You name is required.

    @@ -119,7 +118,7 @@ Groups Selected - + {{groups_selected}} Size of Test Group