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: <crmAddName crm-options="['Alpha','Beta','Gamma']" crm-var="newItem" crm-on-add="callMyCreateFunction(newItem)" />
- 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 ){
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)
+
+
- });
}
};
<ul>
- <li ng-repeat="a in allgroups">a.name</li>
+ <li ng-repeat="a in groups">{{a.title}}</li>
+ </ul>
+ <ul>
+ <li ng-repeat="b in mailings">{{b.name}}</li>
</ul>
-
<div ui-jq="tabs" id="alltabs" >
<ul>
<h3 style="text-decoration: underline;">Select the groups you would like to add</h3><br>
-  <select multiple id="e1" groupselect required name ="grps" required>
- <option value="AL">Mumbai</option>
- <option value="AL">Delhi</option>
- <option value="AL">Madras</option>
- <option value="AL">Kanpur</option>
- <option value="WY">Kharagpur</option>
+  <select multiple groupselect required name ="grps" required ng-model="groups_selected">
+ <option ng-repeat="grp in groups" value={{grp.title}} >{{grp.title}}</option>
+
</select><br><br>
<p ng-show=" impform.grps.$pristine" >You name is required.</p>
</tr>
<tr>
<td>Groups Selected</td>
- <td></td>
+ <td>{{groups_selected}}</td>
</tr>
<tr>
<td>Size of Test Group</td>