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

TypeScript underscore.UnderscoreStatic类代码示例

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

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



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

示例1: function

            angular.forEach(node.nodeAttributes.attributes, function (attr) {
                if (attr.selected) {
                    // Determine column alias
                    var alias = _.find(self.getColumnAliases(node.name, attr.name), function (name: any) {
                        return (aliasCount[name] === 1)
                    });
                    if (typeof(alias) === "undefined") {
                        var i = 0;
                        do {
                            ++i;
                            alias = attr.name + "_" + i;
                        } while (aliasCount[alias] > 0);
                        aliasCount[alias] = 1;
                    }

                    // Add column to target list
                    targetList.push({
                        description: attr.description,
                        name: (alias !== attr.name) ? alias : null,
                        val: {fields: [table, attr.name]}
                    });
                    self.selectedColumnsAndTables_.push({
                        column: attr.name,
                        alias: TABLE_PREFIX + node.id, tableName: node.name,
                        tableColumn: attr.name, dataType: attr.dataType
                    });
                }
            });
开发者ID:prashanthc97,项目名称:kylo,代码行数:28,代码来源:VisualQueryService.ts


示例2: constructor

    /**
     * Constructs a {@code ConnectionDialog}.
     */
    constructor($scope: any, $mdDialog: angular.material.IDialogService, isNew: any, connectionDataModel: any, source: any, dest: any) {

        $scope.isValid = false;
        $scope.connectionDataModel = angular.copy(connectionDataModel);
        $scope.source = angular.copy(source);
        $scope.dest = angular.copy(dest);
        $scope.joinTypes = [{name: "Inner Join", value: "INNER JOIN"}, {name: "Left Join", value: "LEFT JOIN"}, {name: "Right Join", value: "RIGHT JOIN"}];
        $scope.isNew = isNew;

        if (isNew) {
            //attempt to auto find matches
            let sourceNames: any = [];
            let destNames: any = [];
            angular.forEach(source.data.nodeAttributes.attributes, function (attr: any) {
                sourceNames.push(attr.name);
            });

            angular.forEach(dest.data.nodeAttributes.attributes, function (attr: any) {
                destNames.push(attr.name);
            });

            let matches = _.intersection(sourceNames, destNames);
            if (matches && matches.length && matches.length > 0) {
                let col = matches[0];
                if (matches.length > 1) {
                    if (matches[0] == 'id') {
                        col = matches[1];
                    }
                }
                $scope.connectionDataModel.joinKeys.sourceKey = col;
                $scope.connectionDataModel.joinKeys.destKey = col;
                $scope.connectionDataModel.joinType = "INNER JOIN"
            }
        }

        $scope.onJoinTypeChange = function () {
            //    .log('joinType changed')
        };

        $scope.hide = function () {
            $mdDialog.hide();
        };

        $scope.validate = function () {
            $scope.isValid =
                $scope.connectionDataModel.joinType != '' && $scope.connectionDataModel.joinType != null && $scope.connectionDataModel.joinKeys.sourceKey != null
                && $scope.connectionDataModel.joinKeys.destKey != null;
        };

        $scope.save = function () {

            connectionDataModel.name = $scope.connectionDataModel.name;
            connectionDataModel.joinType = $scope.connectionDataModel.joinType;
            connectionDataModel.joinKeys = $scope.connectionDataModel.joinKeys;

            $mdDialog.hide('save');
        };

        $scope.cancel = function () {
            $mdDialog.hide('cancel');
        };

        $scope.delete = function () {
            $mdDialog.hide('delete');
        };

        $scope.validate();

    }
开发者ID:prashanthc97,项目名称:kylo,代码行数:72,代码来源:connection-dialog.component.ts


示例3: Error

    getJoinTree: function (src: any, dst: any, connection: any, graph: any, joinClauses: any) {
        var self = this;

        // Determine left arg
        var larg = (joinClauses.length > 0)
            ? joinClauses.pop()
            : self.getRangeVar(src);

        // Use default if missing join keys
        if (angular.isUndefined(connection.joinKeys.destKey) || angular.isUndefined(connection.joinKeys.sourceKey) || angular.isUndefined(connection.joinType)) {
            joinClauses.push({
                type: VisualQueryService.NodeTag.JoinExpr,
                jointype: VisualQueryService.JoinType.JOIN,
                larg: larg,
                rarg: self.getRangeVar(dst),
                quals: null
            });
            return;
        }

        // Create JOIN clause
        graph[dst.id].seen = true;

        var joinType;
        if (connection.joinType === "INNER JOIN") {
            joinType = VisualQueryService.JoinType.JOIN_INNER;
        } else if (connection.joinType === "LEFT JOIN") {
            joinType = VisualQueryService.JoinType.JOIN_LEFT;
        } else if (connection.joinType === "RIGHT JOIN") {
            joinType = VisualQueryService.JoinType.JOIN_RIGHT;
        } else {
            throw new Error("Not a supported join type: " + connection.joinType);
        }

        var tree: any = {
            type: VisualQueryService.NodeTag.JoinExpr,
            jointype: joinType,
            larg: larg,
            rarg: self.getRangeVar(dst),
            quals: {
                type: VisualQueryService.NodeTag.A_Expr,
                name: "=",
                lexpr: {
                    fields: [TABLE_PREFIX + dst.id, (connection.source.nodeID === src.id) ? connection.joinKeys.sourceKey : connection.joinKeys.destKey]
                },
                rexpr: {
                    fields: [TABLE_PREFIX + src.id, (connection.source.nodeID === src.id) ? connection.joinKeys.destKey : connection.joinKeys.sourceKey]
                }
            }
        };

        // Add conditions for 'seen' tables
        _.values(graph[dst.id].edges)
            .filter(function (edge: any) {
                return (edge != null && edge.source.nodeID !== src.id && graph[edge.source.nodeID].seen && edge.dest.nodeID !== src.id && graph[edge.dest.nodeID].seen);
            })
            .forEach(function (edge: any) {
                var lexpr = tree.quals;
                var rexpr = {
                    type: VisualQueryService.NodeTag.A_Expr,
                    name: "=",
                    lexpr: {
                        fields: [TABLE_PREFIX + edge.source.nodeID, edge.joinKeys.sourceKey]
                    },
                    rexpr: {
                        fields: [TABLE_PREFIX + edge.dest.nodeID, edge.joinKeys.destKey]
                    }
                };
                tree.quals = {
                    type: VisualQueryService.NodeTag.BoolExpr,
                    boolop: VisualQueryService.BoolExprType.AND_EXPR,
                    args: [lexpr, rexpr]
                };

                // Remove join from graph
                graph[edge.source.nodeID].edges[edge.dest.nodeID] = null;
                graph[edge.dest.nodeID].edges[edge.source.nodeID] = null;
            });

        joinClauses.push(tree);
    },
开发者ID:prashanthc97,项目名称:kylo,代码行数:81,代码来源:VisualQueryService.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript underscore._类代码示例发布时间:2022-05-25
下一篇:
TypeScript underscore.zip函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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