How to use the angular.isUndefined 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 sillsdev / web-languageforge / src / angular-app / bellows / core / offline / lexicon-comments.service.ts View on Github external
promises.push(this.lexConfig.getFieldConfig(comment.regarding.field).then(fieldConfig => {
          // As the promise runs when its ready the comments can double up if loadEntryComments is run multiple times
          if (this.comments.items.currentEntry.indexOf(comment) === -1) {
            let contextGuid = '';
            if (comment.contextGuid !== undefined) {
              contextGuid = comment.contextGuid;
            } else {
              contextGuid = comment.regarding.field +
                (comment.regarding.inputSystem ? '.' + comment.regarding.inputSystem : '');
              if (fieldConfig.type === 'multioptionlist') {
                contextGuid += '#' + comment.regarding.fieldValue;
              }
              comment.contextGuid = contextGuid;
            }

            if (contextGuid && angular.isUndefined(this.comments.counts.currentEntry.fields[contextGuid])) {
              this.comments.counts.currentEntry.fields[contextGuid] = 0;
            }

            this.comments.items.currentEntry.push(comment);

            // update the appropriate count for this field and update the total count
            if (comment.status !== 'resolved') {
              if (contextGuid) {
                this.comments.counts.currentEntry.fields[contextGuid]++;
              }

              this.comments.counts.currentEntry.total++;
            }
          }
        }));
      }
github ShuyunFF2E / ccms-components / src / components / toggle / ToggleCtrl.js View on Github external
_prepareOptions() {
		if (angular.isUndefined(this.valueOn)) {
			if (angular.isDefined(this.ngTrueValue)) {
				this.valueOn = this.ngTrueValue;
				console.warn('cc-toggle/cc-switch: ng-true-value/ng-false-value 参数已废弃,请使用 value-on/value-off 代替。');
			} else {
				this.valueOn = ToggleController.valueOn;
			}
		}

		if (angular.isUndefined(this.valueOff)) {
			if (angular.isDefined(this.ngFalseValue)) {
				this.valueOff = this.ngFalseValue;
				console.warn('cc-toggle/cc-switch: ng-true-value/ng-false-value 参数已废弃,请使用 value-on/value-off 代替。');
			} else {
				this.valueOff = ToggleController.valueOff;
			}
		}
github mike-goodwin / owasp-threat-dragon / td / public / app / diagrams / diagramdirectives.js View on Github external
function link(scope, element) {

        if (angular.isUndefined(scope.scale)) {
            scope.scale = 1.0;
        }

        if (angular.isUndefined(scope.padding)) {
            scope.padding = 0.0;
        }

        var graph = diagramming.newGraph();
        var cell = scope.shape.getElement();
        var diagram;

        if (cell.isLink()) {
            diagram = linkStencil(cell, scope.shape.label, element, scope.scale, scope.padding, graph);
        }
        else {
            diagram = elementStencil(cell, scope.shape.label, element, scope.scale, scope.padding, graph);
        }

        diagram.on('cell:pointerclick', scope.action);
        var toolTip = 'Add a new ' + scope.shape.label + ' to the model';
github alien4cloud / alien4cloud / alien4cloud-ui / src / main / webapp / scripts / applications / controllers / application_versions.js View on Github external
$scope.delete = function(versionId) {
        if (!angular.isUndefined(versionId)) {
          versionServices.delete({
            delegateId: delegateId,
            versionId: versionId
          }, null, function(result) {
            if (result) {
              $scope.searchService.search();
              refreshAllAppVersions();
            }
          });
        }
      };
github sillsdev / web-languageforge / src / angular-app / bellows / apps / translate / new-project / translate-new-project.controller.ts View on Github external
}, (newVal: string, oldVal: string) => {
      if (angular.isUndefined(newVal)) {
        this.newProject.projectCode = '';
      } else if (newVal !== oldVal) {
        this.newProject.projectCode = newVal.toLowerCase().replace(/ /g, '_');
      }
    });
github CSCfi / exam / app / frontend / src / examination / navigation / examinationNavigation.component.js View on Github external
const setupNavigation = function () {
                    if (angular.isUndefined(vm.activeSection)) {
                        vm.next = _pages[1];
                        vm.prev = { valid: false };
                    } else {
                        const nextIndex = nextPageIndex();
                        vm.next = nextIndex > -1 ? _pages[nextIndex] : { valid: false };
                        const prevIndex = prevPageIndex();
                        vm.prev = prevIndex > -1 ? _pages[prevIndex] : { valid: false };
                    }
                };
github Enalean / tuleap / src / themes / tlp / angular-tlp / tlp-modal-service.js View on Github external
function getTemplatePromise(template_url) {
        var template = $templateCache.get(template_url);

        if (isUndefined(template)) {
            throw new Error("templateUrl was not stored in templateCache. Did you import it ?");
        }

        return $q.when(template);
    }
github Teradata / kylo / ui / ui-app / src / main / resources / static / js / feed-mgr / shared / entity-access-control / EntityAccessControlService.ts View on Github external
augmentRoleWithUiModel(roleMembership: any) {
        roleMembership.ui = { members: { selectedItem: '', searchText: '' } };
        if (angular.isUndefined(roleMembership.members)) {
            roleMembership.members = [];
        }
    }
    queryForRoleAssignments(entity: any, membersType: any) {
github Enalean / tuleap / src / themes / tlp / angular-tlp / tlp-modal-service.js View on Github external
function isControllerAsOptionValid(options) {
        return !isUndefined(options.controllerAs) && isString(options.controllerAs);
    }
github ngOfficeUIFabric / ng-officeuifabric / src / components / callout / calloutDirective.ts View on Github external
public link(scope: any, instanceElement: angular.IAugmentedJQuery, attrs: any, ctrls: any[]): void {

    let mainWrapper: JQuery = instanceElement.parent().parent();

    if (!angular.isUndefined(mainWrapper) && mainWrapper.hasClass('ms-Callout-main')) {
      let detachedHeader: JQuery = instanceElement.detach();
      mainWrapper.prepend(detachedHeader);
    }
  }
}