How to use the angular.extend function in angular

To help you get started, we’ve selected a few angular examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / angular_v1.5.x / flow_v0.47.x-v0.103.x / test_utility_functions_v1.5.x.js View on Github external
function testExtend() {
  // extends object type
  (angular.extend({ a: 1 }, { b: 2 }): { a: number, b: number });
  (angular.extend({ a: 1 }, { b: 2 }, { c: "str", d: 123 }): {
    a: number,
    b: number,
    c: string,
    d: number
  });
}
github ovh / manager / packages / components / ng-ovh-sso-auth / src / factory.js View on Github external
return ssoAuthentication.getSsoAuthPendingPromise().then(() => {
          config.headers = angular.extend(
            angular.copy(ssoAuthentication.getHeaders()),
            config.headers,
          );

          // For no prefix if begins with http(s)://
          if (urlPrefix && !/^http(?:s)?:\/\//.test(config.url)) {
            config.url = urlPrefix + config.url;
          }

          if (config.timeout) {
            const deferredObjTimeout = $q.defer();

            // Can be cancelled by user
            config.timeout.then(() => {
              deferredObjTimeout.resolve();
            });
github ovh / manager / packages / manager / modules / pci / src / projects / project / legacy / compute / infrastructure / diagram / controller.js View on Github external
this.redrawLinks(true);
        }
      },
      update: () => {
        this.$timeout(() => {
          // deffer save to let jqUI update the array
          this.CloudProjectComputeInfrastructureOrchestrator.saveToUserPref();
        });
      },
    };

    // create vm sortable options by extending sortable options
    this.vmSortableOptions = angular.extend({ handle: '.vm-grip' }, this.sortableOptions);

    // create ip sortable options by extending sortable options
    this.ipSortableOptions = angular.extend({ handle: '.ip-grip' }, this.sortableOptions);
  }
github orizens / echoes / src / core / services / youtube.video.info.srv.js View on Github external
function list(id) {
		setId(id);
		var _config = {
			params: angular.extend({}, config.params)
		};
		return $http.get(url, _config).then(function(res){
			return res.data.items;
		});
	}
github Teradata / kylo / ui / ui-app / src / main / resources / static / js / feed-mgr / services / FeedCreationErrorService.ts View on Github external
reset: function () {
                angular.extend(this.feedError, newErrorData());
            },
            hasErrors: function () {
github mozilla / treeherder / ui / js / models / runnable_job.js View on Github external
const ThRunnableJobModel = function (data) {
            angular.extend(this, data);
        };
github spinnaker / deck / app / scripts / modules / amazon / loadBalancer / loadBalancer.transformer.js View on Github external
var instances = container.instances;
      var serverGroups = container.serverGroups || [container];
      container.healthCounts = {
        upCount: instances.filter(function (instance) {
          return instance.health[0].state === 'InService';
        }).length,
        downCount: instances.filter(function (instance) {
          return instance.health[0].state === 'OutOfService';
        }).length,
        outOfServiceCount: serverGroups.reduce(function (acc, serverGroup) {
          return serverGroup.instances.filter(function (instance) {
            return instance.healthState === 'OutOfService';
          }).length + acc;
        }, 0),
      };
      angular.extend(container, container.healthCounts);
    }
github spinnaker / deck / app / scripts / modules / openstack / src / serverGroup / configure / serverGroupConfiguration.service.js View on Github external
var backingData = command.backingData;
          if (command.credentials) {
            var regionsForAccount = backingData.credentialsKeyedByAccount[command.credentials] || {
              regions: [],
              defaultKeyPair: null,
            };
            backingData.filtered.regions = regionsForAccount.regions;
            if (
              !_.chain(backingData.filtered.regions)
                .some({ name: command.region })
                .value()
            ) {
              command.region = null;
              result.dirty.region = true;
            } else {
              angular.extend(result.dirty, command.regionChanged(command).dirty);
            }
            if (command.region) {
              angular.extend(result.dirty, configureLoadBalancers(command).dirty);
            }
          } else {
            command.region = null;
          }
          return result;
        };
      }
github MoonStorm / trNgGrid / trNgGrid.js View on Github external
GridController.prototype.setColumnOptions = function (columnIndex, columnOptions) {
                var originalOptions = this.gridOptions.gridColumnDefs[columnIndex];
                if (!originalOptions) {
                    throw "Invalid grid column options found for column index " + columnIndex + ". Please report this error.";
                }
                columnOptions = angular.extend(columnOptions, originalOptions);
                this.gridOptions.gridColumnDefs[columnIndex] = columnOptions;
            };
            GridController.prototype.toggleSorting = function (propertyName) {