1 (function(angular
, $, _
) {
3 angular
.module('crmMailingAB', CRM
.angRequires('crmMailingAB'));
4 angular
.module('crmMailingAB').config([
6 function($routeProvider
) {
7 $routeProvider
.when('/abtest', {
8 templateUrl
: '~/crmMailingAB/ListCtrl.html',
9 controller
: 'CrmMailingABListCtrl',
11 mailingABList: function($route
, crmApi
) {
12 return crmApi('MailingAB', 'get', {rowCount
: 0});
14 fields: function(crmMetadata
) {
15 return crmMetadata
.getFields('MailingAB');
19 $routeProvider
.when('/abtest/new', {
20 template
: '<p>' + ts('Initializing...') + '</p>',
21 controller
: 'CrmMailingABNewCtrl',
23 abtest: function($route
, CrmMailingAB
) {
24 var abtest
= new CrmMailingAB(null);
25 return abtest
.load().then(function() {
31 $routeProvider
.when('/abtest/:id', {
32 templateUrl
: '~/crmMailingAB/EditCtrl/main.html',
33 controller
: 'CrmMailingABEditCtrl',
35 mailingFields: function(crmMetadata
) {
36 return crmMetadata
.getFields('Mailing');
38 abtest: function($route
, CrmMailingAB
) {
39 var abtest
= new CrmMailingAB($route
.current
.params
.id
== 'new' ? null : $route
.current
.params
.id
);
47 })(angular
, CRM
.$, CRM
._
);