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

TypeScript angular.isDefined函数代码示例

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

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



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

示例1: function

            link: function (scope: any, elem: any, attrs: any) {

                var scrollSelector = attrs.scrollSelector;

                var offset = angular.isDefined(attrs.offset) ? parseInt(attrs.offset) : 0;
                var scrollContainerElem = angular.isDefined(scrollSelector) ? angular.element(scrollSelector) : $win;
                var currLeftPos = elem[0].offsetLeft;

                scrollContainerElem.on('scroll', function (e) {
                    stickIt();
                });
                function stickIt() {
                    var scrollAmount = scrollContainerElem.scrollTop();
                    elem.css('top', (scrollAmount + offset) + 'px');
                    elem.css('position', 'absolute');
                    elem.css('padding-left', '15px')
                }

                elem.bind("stickIt", function () {
                    stickIt();
                });

                scope.$on('$destroy', function () {
                    elem.unbind("stickIt");
                });

            }
开发者ID:prashanthc97,项目名称:kylo,代码行数:27,代码来源:sticky.ts


示例2: return

 return (str: string, regExStr: string, replaceValue: string) => {
   if (!isDefined(regExStr)) {
     $log.debug(`Did not supply regex string for 'replace' filter.`);
     return str;
   } else if (!isDefined(replaceValue)) {
     $log.debug(`Did not supply replacement value for 'replace' filter.`);
     return str;
   } else {
     return str.replace(new RegExp(regExStr, 'g'), replaceValue);
   }
 };
开发者ID:mizzy,项目名称:deck,代码行数:11,代码来源:replace.filter.ts


示例3:

                                tableOptionInitializerPromise.then((file:any) => {

                                    var serviceName = $scope.tableOption.initializeServiceName;
                                    if(angular.isDefined(serviceName)) {
                                        var svc = $injector.get(serviceName);
                                        if (angular.isDefined(svc) && angular.isFunction(svc.initializeCreateFeed)) {
                                            var createFeedModel = FeedService.createFeedModel;
                                            svc.initializeCreateFeed($scope.tableOption, stepperController, createFeedModel);
                                        }
                                    }
                                });
开发者ID:prashanthc97,项目名称:kylo,代码行数:11,代码来源:TableOptionsStepperDirective.ts


示例4: update

            link: ($scope: any, element: any, attrs: any)=> {

                $scope.truncatedFormat = angular.isDefined($scope.truncatedFormat) ? $scope.truncatedFormat : false;
                $scope.addAgoSuffix = angular.isDefined($scope.addAgoSuffix) ? $scope.addAgoSuffix : false;

                $scope.time = $scope.startTime;
                $scope.previousDisplayStr = '';
                $scope.$watch('startTime', (newVal: any, oldVal: any)=> {
                    $scope.time = $scope.startTime;
                    format();
                })
                format();
                var seconds = 0;
                var minutes = 0;
                var hours = 0;
                var days = 0;
                var months = 0;
                var years = 0;
                if ($scope.refreshTime == undefined) {
                    $scope.refreshTime = 1000;
                }
                function update() {
                    $scope.time += $scope.refreshTime;
                    //format it
                    format();
                }

                function format() {
                    var ms = $scope.time;
                    var displayStr = DateTimeUtils($filter('translate')).formatMillisAsText(ms,$scope.truncatedFormat,false);
                    if($scope.addAgoSuffix) {
                        displayStr += " ago";
                    }

                    if ($scope.previousDisplayStr == '' || $scope.previousDisplayStr != displayStr) {
                        element.html(displayStr);
                        element.attr('title', displayStr);
                    }
                    $scope.previousDisplayStr = displayStr;

                }

                var interval = $interval(update, $scope.refreshTime);

                var clearInterval = ()=> {
                    $interval.cancel(interval);
                    interval = null;
                }
                $scope.$on('$destroy', ()=> {
                    clearInterval()
                });
            }
开发者ID:prashanthc97,项目名称:kylo,代码行数:52,代码来源:kylo-timer.ts


示例5: check

                /**
                 *
                 * @param permissions array of permissions needed (only 1 is needed)
                 * @param entity optional entity
                 */
                function check(permissions: any, entity: any, entityType: any) {

                    if (angular.isDefined(entity) && angular.isDefined(entityType)) {
                        validate(accessControlService.hasEntityAccess(permissions, entity,entityType));
                    }
                    else {
                        accessControlService.getUserAllowedActions(accessControlService.ACCESS_MODULES.SERVICES, true)
                            .then(function (actionSet: any) {
                                var valid = accessControlService.hasAnyAction(permissions, actionSet.actions);
                                validate(valid);
                            }, true);
                    }

                }
开发者ID:prashanthc97,项目名称:kylo,代码行数:19,代码来源:ng-if-permission.ts


示例6: text

 this.text = function text(textId: string, projectId?: string): string {
   if (angular.isDefined(projectId)) {
     return this.project(projectId) + textId;
   } else {
     return this.project() + textId;
   }
 };
开发者ID:sillsdev,项目名称:web-scriptureforge,代码行数:7,代码来源:link.service.ts


示例7: setupField

  /**
   * Sets up and configures properties for a dialog field
   * @memberof DialogDataService
   * @function setupField
   * @param data {any} This is a object that is all the information for a particular dialog field
   *
   **/
  public setupField(data: any) {
    let field = _.cloneDeep(data);
    const dropDownValues = [];
    field.fieldValidation = null;
    field.fieldBeingRefreshed = (angular.isDefined(field.fieldBeingRefreshed) ? field.fieldBeingRefreshed : false);
    field.errorMessage = '';

    if (field.type === 'DialogFieldDropDownList') {
      for (let option of field.values) {
        if (option[0] === String(field.default_value)) {
          field.selected = option;
        }
        if (field.data_type === 'integer') {
          dropDownValues.push([parseInt(option[0], 10), option[1]]);
        } else {
          dropDownValues.push(option);
        }
      }
      field.values = dropDownValues;
      field.values = this.updateFieldSortOrder(field);
    }
    field.default_value = this.setDefaultValue(field);

    return field;
  }
开发者ID:karelhala,项目名称:ui-components,代码行数:32,代码来源:dialogData.ts


示例8: function

		vm.openColumnsSortPanel = function (value) {
			if (angular.isDefined(value))
				vm.columnSortPanelOpened = value;
			else {
				vm.columnSortPanelOpened = !vm.columnSortPanelOpened;
			}
		}
开发者ID:izenda,项目名称:resources,代码行数:7,代码来源:instant-report-data-source-controller.ts


示例9: setDefaultValue

  /**
   *
   * This method sets default value for a dialog field
   * @memberof DialogDataService
   * @function setDefaultValue
   * @param data {any} This is a object that is all the information for a particular dialog field
   *
   **/
  private setDefaultValue(data): any {
    let defaultValue: any = '';
    const firstOption = 0; // these are meant to help make code more readable
    const fieldValue = 0;
    if (_.isObject(data.values)) {
      if (angular.isDefined(data.default_value) && data.default_value !== null) {
        defaultValue = data.default_value;
      } else {
        defaultValue = data.values[firstOption][fieldValue];
      }
    } else {
      if (data.type === 'DialogFieldDateControl' || data.type === 'DialogFieldDateTimeControl') {
        defaultValue = new Date(data.values);
      } else {
          defaultValue = data.values;
      }
    }
    if (data.default_value) {
      defaultValue = data.default_value;
    }

    if (data.data_type === 'integer') {
      defaultValue = parseInt(data.default_value, 10);
    }

    return defaultValue;
  }
开发者ID:karelhala,项目名称:ui-components,代码行数:35,代码来源:dialogData.ts


示例10: project

 this.project = function project(projectId?: string, projectType: string = 'sfchecks'): string {
   if (angular.isDefined(projectId)) {
     return '/app/' + projectType + '/' + projectId + '#!/';
   } else {
     return '#!/';
   }
 };
开发者ID:sillsdev,项目名称:web-scriptureforge,代码行数:7,代码来源:link.service.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript angular.isFunction函数代码示例发布时间:2022-05-28
下一篇:
TypeScript angular.isArray函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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