How to use the angular.isArray 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 swimlane / angular-model-factory / src / utils.js View on Github external
angular.forEach(obj, function(value, key) {
        if (instanceKeywords.indexOf(key) === -1) {
          if (dst[key]) {
            if (angular.isArray(dst[key])) {
              dst[key].concat(value.filter(function(v) {
                var vv = dst[key].indexOf(v) !== -1;
                if (vv) extendDeep(vv, v);
                return vv;
              }));
            } else if (angular.isObject(dst[key])) {
              extendDeep(dst[key], value);
            } else {
              // if value is a simple type like a string, boolean or number
              // then assign it
              dst[key] = value;
            }
          } else if (!angular.isFunction(dst[key])) {
            dst[key] = value;
          }
        }
github Teradata / kylo / ui / ui-app / src / main / resources / static / js / feed-mgr / feeds / define-feed / feed-details / DefineFeedDataProcessingDirective.ts View on Github external
if (!angular.isString(policy.domainTypeId) || policy.domainTypeId === "") {
            delete policy.$currentDomainType;
            return;
        }

        // Find domain type from id
        var domainType = _.find(this.availableDomainTypes, (domainType: any) => {
            return (domainType.id === policy.domainTypeId);
        });

        // Apply domain type to field
        var promise;

        if ((domainType.field.derivedDataType !== null && (domainType.field.derivedDataType !== policy.field.derivedDataType || domainType.field.precisionScale !== policy.field.precisionScale))
            || (angular.isArray(policy.standardization) && policy.standardization.length > 0)
            || (angular.isArray(policy.field.tags) && policy.field.tags.length > 0)
            || (angular.isArray(policy.validation) && policy.validation.length > 0)) {
            promise = this.$mdDialog.show({
                controller: "ApplyDomainTypeDialogController",
                escapeToClose: false,
                fullscreen: true,
                parent: angular.element(document.body),
                templateUrl: "../../../shared/apply-domain-type/apply-domain-type-dialog.html",
                locals: {
                    domainType: domainType,
                    field: policy.field
                }
            });
        } else {
            promise = Promise.resolve();
        }
        promise.then(() =>{
github leftstick / generator-es6-angular / generators / app / templates / js / fw / helper / Object.js View on Github external
export function omit(obj, keys) {
    if (!isObject(obj)) {
        return obj;
    }
    if (isArray(keys) && keys.length === 0) {
        return obj;
    }
    if (isString(keys) && !keys) {
        return obj;
    }
    if (!isString(keys) && !isArray(keys)) {
        return obj;
    }
    const o = clone(obj);
    keys.forEach(function(key) {
        delete o[key];
    });
    return o;
}
github leftstick / BaiduMapForAngularJS / demo / js / fw / helper / object.js View on Github external
export function omit(obj, keys) {
    if (!isObject(obj)) {
        return obj;
    }
    if (isArray(keys) && keys.length === 0) {
        return obj;
    }
    if (isString(keys) && !keys) {
        return obj;
    }
    if (!isString(keys) && !isArray(keys)) {
        return obj;
    }
    const o = clone(obj);
    keys.forEach(function(key) {
        delete o[key];
    });
    return o;
}
github spinnaker / deck / app / scripts / modules / core / src / task / task.dataSource.js View on Github external
const addTasks = (application, tasks) => {
      return $q.when(angular.isArray(tasks) ? tasks : []);
    };
github ffan-fe / fancyui / src / components / citySelector / city.selector.controller.js View on Github external
formatData(dataList) {
    if (dataList && angular.isArray(dataList)) {
      dataList.forEach(item => {
        if (item.child) {
          this.formatNodeData(item, item.child);
        }
      });
    }
  }
  /**
github Teradata / kylo / ui / ui-app / src / main / resources / static / js / feed-mgr / datasources / DatasourcesDetailsController.ts View on Github external
onDelete = () => {
        if (!angular.isArray(this.model.sourceForFeeds) || this.model.sourceForFeeds.length === 0) {
            this.datasourcesService.deleteById(this.model.id)
                .then(() => {
                    this.$mdToast.show(
                        this.$mdToast.simple()
                            .textContent("Successfully deleted the data source " + this.model.name + ".")
                            .hideDelay(3000)
                    );
                    this.stateService.FeedManager().Datasource().navigateToDatasources();
                }, (err: any) => {
                    this.$mdDialog.show(
                        this.$mdDialog.alert()
                            .clickOutsideToClose(true)
                            .title("Delete Failed")
                            .textContent("The data source '" + this.model.name + "' could not be deleted." + err.data.message)
                            .ariaLabel("Failed to delete data source")
                            .ok("Got it!")
github GridProtectionAlliance / openHistorian / Source / Applications / openHistorian / openHistorian / Grafana / public / app / core / directives / tags.ts View on Github external
link: function(scope: any, element: any, attrs: any) {
      if (!angular.isArray(scope.model)) {
        scope.model = [];
      }

      const select = $('select', element);

      if (attrs.placeholder) {
        select.attr('placeholder', attrs.placeholder);
      }

      select.tagsinput({
        typeahead: {
          source: angular.isFunction(scope.$parent[attrs.typeaheadSource])
            ? scope.$parent[attrs.typeaheadSource]
            : null,
        },
        widthClass: attrs.widthClass,
github LiskHQ / lisk-explorer / src / services / less-more-by-timestamp.js View on Github external
LessMoreByTimestamp.prototype.loadLess = function () {
	this.lessData = false;
	this.moreData = true;
	if (angular.isArray(this.results)) {
		this.results.splice(-this.splice, this.splice);
		this.lessData = this.anyLess(this.results.length);
	}
	this.updateTimestamp();
};