templateUrl: '~/search/crmSearchActions.html',
controller: function($scope, crmApi4, dialogService, searchMeta) {
var ts = $scope.ts = CRM.ts(),
- entityTitle = searchMeta.getEntity(this.entity).titlePlural,
ctrl = this;
- this.init = function() {
+ this.$onInit = function() {
+ var entityTitle = searchMeta.getEntity(ctrl.entity).titlePlural;
if (!ctrl.actions) {
var actions = _.transform(_.cloneDeep(CRM.vars.search.actions), function (actions, action) {
if (_.includes(action.entities, ctrl.entity)) {
controller: function($scope, formatForSelect2, searchMeta) {
var ts = $scope.ts = CRM.ts(),
ctrl = this;
- this.functions = formatForSelect2(_.where(CRM.vars.search.functions, {category: this.cat}), 'name', 'title');
this.$onInit = function() {
+ ctrl.functions = formatForSelect2(_.where(CRM.vars.search.functions, {category: ctrl.cat}), 'name', 'title');
var fieldInfo = searchMeta.parseExpr(ctrl.expr);
ctrl.path = fieldInfo.path + fieldInfo.suffix;
ctrl.field = fieldInfo.field;