當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。