• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript core_module.controller函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中app/core/core_module.controller函数的典型用法代码示例。如果您正苦于以下问题:TypeScript controller函数的具体用法?TypeScript controller怎么用?TypeScript controller使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了controller函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: function

    $scope.reset = function() {
      $scope.currentIsNew = true;
      $scope.current = variableSrv.createVariableFromModel({type: 'query'});
    };

    $scope.typeChanged = function() {
      var old = $scope.current;
      $scope.current = variableSrv.createVariableFromModel({type: $scope.current.type});
      $scope.current.name = old.name;
      $scope.current.hide = old.hide;
      $scope.current.label = old.label;

      var oldIndex = _.indexOf(this.variables, old);
      if (oldIndex !== -1) {
        this.variables[oldIndex] = $scope.current;
      }

      $scope.validate();
    };

    $scope.removeVariable = function(variable) {
      var index = _.indexOf($scope.variables, variable);
      $scope.variables.splice(index, 1);
      $scope.dashboard.updateSubmenuVisibility();
    };
  }
}

coreModule.controller('VariableEditorCtrl', VariableEditorCtrl);

开发者ID:housecream,项目名称:server,代码行数:29,代码来源:editor_ctrl.ts


示例2: constructor

class AdminSettingsCtrl {
  navModel: any;

  /** @ngInject */
  constructor($scope, backendSrv, navModelSrv) {
    this.navModel = navModelSrv.getNav('admin', 'server-settings', 0);

    backendSrv.get('/api/admin/settings').then(settings => {
      $scope.settings = settings;
    });
  }
}

class AdminHomeCtrl {
  navModel: any;

  /** @ngInject */
  constructor(navModelSrv) {
    this.navModel = navModelSrv.getNav('admin', 0);
  }
}

coreModule.controller('AdminListUsersCtrl', AdminListUsersCtrl);
coreModule.controller('AdminEditUserCtrl', AdminEditUserCtrl);
coreModule.controller('AdminListOrgsCtrl', AdminListOrgsCtrl);
coreModule.controller('AdminEditOrgCtrl', AdminEditOrgCtrl);
coreModule.controller('AdminSettingsCtrl', AdminSettingsCtrl);
coreModule.controller('AdminHomeCtrl', AdminHomeCtrl);
coreModule.controller('StyleGuideCtrl', StyleGuideCtrl);
开发者ID:bergquist,项目名称:grafana,代码行数:29,代码来源:index.ts


示例3:

    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20,
  ]);
  $scope.addOverrideOption('Points', 'points', [true, false]);
  $scope.addOverrideOption('Points Radius', 'pointradius', [1, 2, 3, 4, 5]);
  $scope.addOverrideOption('Stack', 'stack', [true, false, 'A', 'B', 'C', 'D']);
  $scope.addOverrideOption('Color', 'color', ['change']);
  $scope.addOverrideOption('Y-axis', 'yaxis', [1, 2]);
  $scope.addOverrideOption('Z-index', 'zindex', [-3, -2, -1, 0, 1, 2, 3]);
  $scope.addOverrideOption('Transform', 'transform', ['negative-Y']);
  $scope.addOverrideOption('Legend', 'legend', [true, false]);
  $scope.addOverrideOption('Hide in tooltip', 'hideTooltip', [true, false]);
  $scope.updateCurrentOverrides();
}

coreModule.controller('SeriesOverridesCtrl', SeriesOverridesCtrl);
开发者ID:bergquist,项目名称:grafana,代码行数:30,代码来源:series_overrides_ctrl.ts


示例4: removeUserConfirmed

    this.$scope.appEvent('confirm-modal', {
      title: 'Delete',
      text: 'Are you sure you want to delete user ' + user.login + '?',
      yesText: 'Delete',
      icon: 'fa-warning',
      onConfirm: () => {
        this.removeUserConfirmed(user);
      },
    });
  }

  removeUserConfirmed(user) {
    this.backendSrv.delete('/api/org/users/' + user.userId).then(this.get.bind(this));
  }

  revokeInvite(invite, evt) {
    evt.stopPropagation();
    this.backendSrv.patch('/api/org/invites/' + invite.code + '/revoke').then(this.get.bind(this));
  }

  copyInviteToClipboard(evt) {
    evt.stopPropagation();
  }

  getInviteUrl(invite) {
    return invite.url;
  }
}

coreModule.controller('OrgUsersCtrl', OrgUsersCtrl);
开发者ID:ArcticSnowman,项目名称:grafana,代码行数:30,代码来源:org_users_ctrl.ts


示例5:

import coreModule from 'app/core/core_module';

import { DashboardListCtrl } from './DashboardListCtrl';
import { SnapshotListCtrl } from './SnapshotListCtrl';

coreModule.controller('DashboardListCtrl', DashboardListCtrl);
coreModule.controller('SnapshotListCtrl', SnapshotListCtrl);
开发者ID:ArcticSnowman,项目名称:grafana,代码行数:7,代码来源:index.ts


示例6: confirmDelete

      }
    };

    confirmDelete() {
      this.backendSrv.delete('/api/datasources/' + this.current.id).then(() => {
        this.$location.path('datasources');
      });
    }

    delete(s) {
      this.$scope.appEvent('confirm-modal', {
        title: 'Delete',
        text: 'Are you sure you want to delete this datasource?',
        yesText: "Delete",
        icon: "fa-trash",
        onConfirm: () => {
          this.confirmDelete();
        }
      });
    }
}

coreModule.controller('DataSourceEditCtrl', DataSourceEditCtrl);

coreModule.directive('datasourceHttpSettings', function() {
  return {
    scope: {current: "="},
    templateUrl: 'public/app/features/plugins/partials/ds_http_settings.html'
  };
});
开发者ID:ArtyomyuS,项目名称:grafana,代码行数:30,代码来源:ds_edit_ctrl.ts


示例7:

      return results => {
        const segments = _.map(results, segment => {
          return uiSegmentSrv.newSegment({
            value: segment.text,
            expandable: segment.expandable,
          });
        });

        if (addTemplateVars) {
          _.each(templateSrv.variables, variable => {
            segments.unshift(
              uiSegmentSrv.newSegment({
                type: 'template',
                value: '$' + variable.name,
                expandable: true,
              })
            );
          });
        }

        return segments;
      };
    };

    $scope.init();
  }
}

coreModule.directive('cloudwatchQueryParameter', CloudWatchQueryParameter);
coreModule.controller('CloudWatchQueryParameterCtrl', CloudWatchQueryParameterCtrl);
开发者ID:acedrew,项目名称:grafana,代码行数:30,代码来源:query_parameter_ctrl.ts


示例8: constructor

import coreModule from 'app/core/core_module';

export default class CreateTeamCtrl {
  name: string;
  email: string;
  navModel: any;

  /** @ngInject **/
  constructor(private backendSrv, private $location, navModelSrv) {
    this.navModel = navModelSrv.getNav('cfg', 'teams', 0);
  }

  create() {
    const payload = {
      name: this.name,
      email: this.email,
    };
    this.backendSrv.post('/api/teams', payload).then(result => {
      if (result.teamId) {
        this.$location.path('/org/teams/edit/' + result.teamId);
      }
    });
  }
}

coreModule.controller('CreateTeamCtrl', CreateTeamCtrl);
开发者ID:GPegel,项目名称:grafana,代码行数:26,代码来源:create_team_ctrl.ts


示例9: constructor

export class NewDashboardCtrl {
  /** @ngInject */
  constructor($scope, $routeParams) {
    $scope.initDashboard(
      {
        meta: {
          canStar: false,
          canShare: false,
          isNew: true,
          folderId: Number($routeParams.folderId),
        },
        dashboard: {
          title: 'New dashboard',
          panels: [
            {
              type: 'add-panel',
              gridPos: { x: 0, y: 0, w: 12, h: 9 },
              title: 'Panel Title',
            },
          ],
        },
      },
      $scope
    );
  }
}

coreModule.controller('LoadDashboardCtrl', LoadDashboardCtrl);
coreModule.controller('NewDashboardCtrl', NewDashboardCtrl);
开发者ID:xiequanqin,项目名称:grafana,代码行数:29,代码来源:dashboard_loaders.ts


示例10: react2AngularDirective

import './unsaved_changes_modal';
import './timepicker/timepicker';
import './upload';
import './export/export_modal';
import './export_data/export_data_modal';
import './ad_hoc_filters';
import './repeat_option/repeat_option';
import './dashgrid/DashboardGridDirective';
import './dashgrid/PanelLoader';
import './dashgrid/RowOptions';
import './folder_picker/folder_picker';
import './move_to_folder_modal/move_to_folder';
import './settings/settings';
import './panellinks/module';
import './dashlinks/module';

// angular wrappers
import { react2AngularDirective } from 'app/core/utils/react2angular';
import DashboardPermissions from './permissions/DashboardPermissions';

react2AngularDirective('dashboardPermissions', DashboardPermissions, ['dashboardId', 'folder']);

import coreModule from 'app/core/core_module';
import { FolderDashboardsCtrl } from './folder_dashboards_ctrl';
import { DashboardImportCtrl } from './dashboard_import_ctrl';
import { CreateFolderCtrl } from './create_folder_ctrl';

coreModule.controller('FolderDashboardsCtrl', FolderDashboardsCtrl);
coreModule.controller('DashboardImportCtrl', DashboardImportCtrl);
coreModule.controller('CreateFolderCtrl', CreateFolderCtrl);
开发者ID:ArcticSnowman,项目名称:grafana,代码行数:30,代码来源:all.ts



注:本文中的app/core/core_module.controller函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap