当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript angular.equals函数代码示例

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


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

示例1: equals

 equals(other: VendorItem) {
   // Defs can be ref-compared
   return this.vendorItemDef === other.vendorItemDef &&
     this.canPurchase === other.canPurchase &&
     // Deep equals
     equals(this.saleItem, other.saleItem);
 }
开发者ID:delphiactual,项目名称:DIM,代码行数:7,代码来源:vendor-item.ts

示例2: function

          const updateVisibility = function() {
            const rect = element[0].getBoundingClientRect();

            const newVisibility = {top: 'visible', bottom: 'visible', left: 'visible', right: 'visible'};

            if (rect.bottom < offset.top) {
              newVisibility.top = 'hidden';
            } else if (rect.top < offset.top) {
              newVisibility.top = 'partial';
            }

            if (rect.top > $window.innerHeight - offset.bottom) {
              newVisibility.bottom = 'hidden';
            } else if (rect.bottom > $window.innerHeight - offset.bottom) {
              newVisibility.bottom = 'partial';
            }

            if (rect.right < offset.left) {
              newVisibility.left = 'hidden';
            } else if (rect.left < offset.left) {
              newVisibility.left = 'partial';
            }

            if (rect.left > $window.innerWidth - offset.right) {
              newVisibility.bottom = 'hidden';
            } else if (rect.right > $window.innerWidth - offset.right) {
              newVisibility.bottom = 'partial';
            }

            // return if unchanged
            if (angular.equals(oldVisibility, newVisibility)) return;
            oldVisibility = newVisibility;

            scope.$evalAsync(attrs.onVisibilityChanged, {$visibility: newVisibility});
          };
开发者ID:paperhive,项目名称:paperhive-frontend,代码行数:35,代码来源:on-visibility-changed.ts

示例3: function

			Array.prototype['indexOfObject'] = function(obj) {
				for(var i = 0; i < this.length; i++){
					if(angular.equals(this[i], obj)){
						return i;
					}
				};
				return -1;
			}
开发者ID:brian-rowe,项目名称:krossr,代码行数:8,代码来源:AppModule.ts

示例4: function

 return function(){
     var oldPages = currentPages;
     var newPages = self.generatePagesArray(self.page(), self.total(), self.count());
     if (!ng1.equals(oldPages, newPages)){
         currentPages = newPages;
         ngTableEventsChannel.publishPagesChanged(this, newPages, oldPages);
     }
 }
开发者ID:Timeyit,项目名称:main,代码行数:8,代码来源:ngTableParams.ts

示例5: expect

 dataTableSettings.retrieveRowsAndColumnsFromUrl(modelName, tree, currId).then((responseData: IRowsColsResponse) => {
   expect(responseData.cols.length > 0).toBeTruthy();
   expect(responseData.rows.length > 0).toBeTruthy();
   expect(angular.equals(
     responseData.settings,
     {perpage: 20, current: 1, items: 6, total: 1}
   )).toBeTruthy();
   done();
 });
开发者ID:ManageIQ,项目名称:ui-components,代码行数:9,代码来源:dataTableService.spec.ts

示例6: it

 it('should generate full config', () => {
   expect(
     angular.equals(
       DataTableSettingsService.generateConfig(modelName, tree, currId),
       {
         model: modelName,
         model_name: modelName,
         active_tree: tree,
         model_id: currId,
         parent_id: currId
       }
     )
   ).toBeTruthy();
 });
开发者ID:ManageIQ,项目名称:ui-components,代码行数:14,代码来源:dataTableService.spec.ts

示例7:

                angular.forEach(items, (item: any)=> {
                    var valueToCheck, isDuplicate = false;

                    for (var i = 0; i < newItems.length; i++) {
                        if (angular.equals(extractValueToCompare(newItems[i]), extractValueToCompare(item))) {
                            isDuplicate = true;
                            break;
                        }
                    }
                    if (!isDuplicate) {
                        newItems.push(item);
                    }

                });
开发者ID:prashanthc97,项目名称:kylo,代码行数:14,代码来源:filters.ts

示例8: function

          const resizeHandler = function() {
            const newSize = {
              height: element[0].offsetHeight,
              width: element[0].offsetWidth,
              scrollHeight: element[0].scrollHeight,
              scrollWidth: element[0].scrollWidth,
            };

            // return if unchanged
            if (angular.equals(newSize, oldSize)) return;

            oldSize = newSize;

            scope.$evalAsync(attrs.onResized, {$size: newSize});
          };
开发者ID:paperhive,项目名称:paperhive-frontend,代码行数:15,代码来源:on-resized.ts

示例9: function

          const resizeHandler = function(e) {
            const newSize = {
              height: element[0].offsetHeight,
              width: element[0].offsetWidth
            };

            // return if unchanged
            if (angular.equals(size, newSize)) {
              return;
            }

            // copy object
            angular.copy(newSize, size);

            // call apply if this function has been called as an event handler
            if (e) {
              scope.$apply();
            }
          };
开发者ID:carolinagc,项目名称:paperhive-frontend,代码行数:19,代码来源:elementSize.ts

示例10: function

          const positionHandler = function(e) {
            const rect = element[0].getBoundingClientRect();
            // angular.copy and _.clone do *not* work here -> copy manually
            const properties =
              ['bottom', 'height', 'left', 'right', 'top', 'width'];
            const newPosition = {};
            angular.forEach(properties, function(property) {
              newPosition[property] = rect[property];
            });

            // return if unchanged
            if (angular.equals(position, newPosition)) {
              return;
            }

            // copy object
            angular.copy(newPosition, position);

            // call apply if this function has been called as an event handler
            if (e) {
              scope.$apply();
            }
          };
开发者ID:carolinagc,项目名称:paperhive-frontend,代码行数:23,代码来源:elementPosition.ts


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