How to use the angular.isObject 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 Teradata / kylo / ui / ui-app / src / main / resources / static / js / feed-mgr / feeds / define-feed / feed-details / DefineFeedAccessControlDirective.ts View on Github external
transformChip(chip:any){
        // If it is an object, it's already a known chip
        if (angular.isObject(chip)) {
            return chip;
        }
        // Otherwise, create a new one
        return {name: chip}
    }
}
github mimarec / swagger-doc-viewer / swagger-editor / scripts / controllers / tryoperation.js View on Github external
$scope.isJson = function(value) {
    // if value is already parsed return true
    if (angular.isObject(value) || angular.isArray(value)) {
      return true;
    }

    var err;
    try {
      JSON.parse(value);
    } catch (error) {
      err = error;
    }

    return !err;
  };
github Enalean / tuleap / src / themes / tlp / angular-tlp / tlp-modal-service.js View on Github external
function isTlpModalOptionValid(options) {
        return isUndefined(options.tlpModalOptions) || isObject(options.tlpModalOptions);
    }
github Enalean / tuleap / src / themes / tlp / angular-tlp / tlp-modal-service.js View on Github external
function isResolveOptionValid(options) {
        return isUndefined(options.resolve) || isObject(options.resolve);
    }
github Teradata / kylo / ui / ui-app / src / main / resources / static / js / feed-mgr / services / FeedService.ts View on Github external
setControllerServicePropertyDisplayName=(property: any) => {

            let setDisplayValue = (property :any) : boolean => {
                let cacheEntry:string = controllerServiceDisplayCache[property.value];
                if(cacheEntry != null) {
                    property.displayValue =cacheEntry;
                    return true;
                }
                return false;
            }

            if(angular.isObject(property.propertyDescriptor) && angular.isString(property.propertyDescriptor.identifiesControllerService)) {
                if (!setDisplayValue(property)) {

                    let entry: any = controllerServiceDisplayCachePromiseTracker[property.propertyDescriptor.identifiesControllerService];
                    if (entry == undefined) {
                        let promise = this.getAvailableControllerServices(property.propertyDescriptor.identifiesControllerService);
                        entry = {request: promise, waitingProperties: []};
                        entry.waitingProperties.push(property);
                        controllerServiceDisplayCachePromiseTracker[property.propertyDescriptor.identifiesControllerService] = entry;
                        promise.then((services: any) => {
                            _.each(services, (service: any) => {
                                controllerServiceDisplayCache[service.id] = service.name;
                            });
                            _.each(entry.waitingProperties, (property: any) => {
                                setDisplayValue(property);
                            });
                            delete controllerServiceDisplayCachePromiseTracker[property.propertyDescriptor.identifiesControllerService];
github swagger-api / swagger-editor / scripts / controllers / preview.js View on Github external
function showDefinitions(definitions) {
    return angular.isObject(definitions);
  }
github Teradata / kylo / ui / ui-app / src / main / resources / static / js / feed-mgr / services / FeedService.ts View on Github external
setDomainTypeForField(field: TableColumnDefinition, policy: TableFieldPolicy, domainType: DomainType) {
                policy.$currentDomainType = domainType;
                policy.domainTypeId = domainType.id;

                if (angular.isObject(domainType.field)) {
                    field.tags = angular.copy(domainType.field.tags);
                    if (angular.isString(domainType.field.name) && domainType.field.name.length > 0) {
                        field.name = domainType.field.name;
                    }
                    if (angular.isString(domainType.field.derivedDataType) && domainType.field.derivedDataType.length > 0) {
                        field.derivedDataType = domainType.field.derivedDataType;
                        field.precisionScale = domainType.field.precisionScale;
                        field.dataTypeDisplay = this.getDataTypeDisplay(field);
                    }
                }

                if (angular.isObject(domainType.fieldPolicy)) {
                    policy.standardization = angular.copy(domainType.fieldPolicy.standardization);
                    policy.validation = angular.copy(domainType.fieldPolicy.validation);
                }
            }
github Teradata / kylo / ui / ui-app / src / main / resources / static / js / feed-mgr / feeds / define-feed-ng2 / summary / feed-lineage / feed-lineage.componment.ts View on Github external
setNodeStyle(node: any, style: any) {
        if (style) {
            if ((style.shape == 'icon' || !style.shape) && style.icon && style.icon.code) {
                node.shape = 'icon';
                if (angular.isObject(style.icon)) {
                    node.icon = style.icon;
                }
            }
            else if (style.shape) {
                node.shape = style.shape;
            }

            if (style.color) {
                node.color = style.color;
            }
            if (style.size) {
                node.size = style.size;
            }
            if (style.font) {
                node.font = style.font;
            }
github grafana / grafana / public / app / core / services / ng_react.ts View on Github external
function getPropWatchDepth(defaultWatch: string, prop: string | any[]) {
  const customWatchDepth = Array.isArray(prop) && angular.isObject(prop[1]) && prop[1].watchDepth;
  return customWatchDepth || defaultWatch;
}
github qgrid / ng / demo / pages / json-editor / index.js View on Github external
build(graph, name = 'root', level = 0, kind) {
		if (angular.isArray(graph)) {
			return this.buildArray(graph, name, level, kind);
		}
		else if (angular.isObject(graph)) {
			return this.buildObject(graph, name, level, kind);
		}

		const node = new this.Node(name, level, 'value');
		node.value = graph;
		node.kind = kind;
		return node;
	}