當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript angular.isUndefined函數代碼示例

本文整理匯總了TypeScript中angular.isUndefined函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript isUndefined函數的具體用法?TypeScript isUndefined怎麽用?TypeScript isUndefined使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了isUndefined函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

             var initDashboard = (dashboard:any) => {
                 data.dashboard = dashboard;
                 //if the pagable feeds query came after this one it will flip the skip flag.
                 // that should supercede this request
                 if(!data.skipDashboardFeedHealth) {
                     data.feedsSearchResult = dashboard.feeds;
                     if (data.dashboard && data.dashboard.feeds && data.dashboard.feeds.data) {
                         var processedFeeds = data.setupFeedHealth(data.dashboard.feeds.data);
                         data.dashboard.feeds.data = processedFeeds;
                         data.totalFeeds = data.dashboard.feeds.recordsFiltered;
                     }
                 }
                 else {
                    //     console.log('Skip processing dashboard results for the feed since it was superceded');
                 }
                 if(angular.isUndefined(data.dashboard.healthCounts['UNHEALTHY'])) {
                     data.dashboard.healthCounts['UNHEALTHY'] = 0;
                 }
                 if(angular.isUndefined(data.dashboard.healthCounts['HEALTHY'])) {
                     data.dashboard.healthCounts['HEALTHY'] = 0;
                 }

                 data.feedUnhealthyCount = data.dashboard.healthCounts['UNHEALTHY'] || 0;
                 data.feedHealthyCount = data.dashboard.healthCounts['HEALTHY'] || 0;
                 data.activeDashboardRequest = null;
                 BroadcastService.notify(data.DASHBOARD_UPDATED, dashboard);
             }
開發者ID:prashanthc97,項目名稱:kylo,代碼行數:27,代碼來源:OpsManagerDashboardService.ts

示例2: function

 this.findAndReplaceString = function(str:any, findStr:any, replacementStr:any) {
     var i = 0;
     if(angular.isUndefined(str) || angular.isUndefined(findStr)){
         return '';
     }
     else {
         var strLength = str.length;
         for (i; i < strLength; i++) {
             str = str.replace(findStr, replacementStr);
         }
         return str;
     }
 };
開發者ID:prashanthc97,項目名稱:kylo,代碼行數:13,代碼來源:FeedDetailsController.ts

示例3: function

        return function (items: any, filterOn: any) {

            if (filterOn === false) {
                return items;
            }

            if ((filterOn || angular.isUndefined(filterOn)) && angular.isArray(items)) {
                var hashCheck: any = {}, newItems: any[] = [];

                var extractValueToCompare = function (item: any) {
                    if (angular.isObject(item) && angular.isString(filterOn)) {
                        return item[filterOn];
                    } else {
                        return item;
                    }
                };

                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);
                    }

                });
                items = newItems;
            }
            return items;
        };
開發者ID:prashanthc97,項目名稱:kylo,代碼行數:35,代碼來源:filters.ts

示例4: isNull

 /**
  * 判斷是否為空
  * @param data 數據
  */
 public isNull (data){
     if(data == null || data == '' || angular.isUndefined(data)){
         return true;
     }else{
         return false;
     }
 }
開發者ID:zhousw,項目名稱:lgappIonic,代碼行數:11,代碼來源:commonUtil.ts

示例5: function

            uusi: function(kohdealue) {
                if (angular.isUndefined(kohdealue.arvioinninKohteet) || kohdealue.arvioinninKohteet === null) {
                    kohdealue.arvioinninKohteet = [];
                }

                var kohde = {
                    otsikko: {},
                    selite: {
                        fi: "Opiskelija",
                        sv: "Den studerande"
                    },
                    _arviointiAsteikko: kohdealue.$$newkohde.arviointiasteikko.id,
                    osaamistasonKriteerit: [],
                    $$accordionOpen: true
                };

                kohde.otsikko[YleinenData.kieli] = kohdealue.$$newkohde.nimi;

                valmisteleKriteerit(kohde.osaamistasonKriteerit, kohdealue.$$newkohde.arviointiasteikko.osaamistasot);

                kohdealue.arvioinninKohteet.push(kohde);
                kohdealue.$$newkohde = {};
                $timeout(function() {
                    $scope.kohde.muokkaa(kohde);
                });
            },
開發者ID:Opetushallitus,項目名稱:eperusteet,代碼行數:26,代碼來源:arviointi.ts

示例6: require

  .config( ($routeProvider, $locationProvider, $logProvider) => {
    // Set debug to true by default.
    if ((angular.isUndefined(Config.debug)) || Config.debug != false) {
      Config.debug = true
    }

    // Disable logging if debug is off.
    if (!Config.debug) {
      $logProvider.debugEnabled(false);
    }

    // Loop over routes and add to router.
    angular.forEach(Config.routes, (route) => {
      if (route.component) {
        // convert `ngModel` style to `ng-model` style
        let tag = route.component.replace(/([A-Z])/g, '-$1').toLowerCase();
        tag = _.trim(tag, '-');
        route.params.template = `<${tag} component="${route.component}"></${tag}>`;
      }
      $routeProvider.when(route.url, route.params);
    });
    // Otherwise
    $routeProvider.otherwise({
      template: require('../common/partials/404.html')
    })

    // Set to use HTML5 mode, which removes the #! from modern browsers.
    // Only when config it and browser support HTML5 history API
    let isHtml5Mode = !!Config.urlHtml5Mode && (window.history && 'pushState' in window.history);
    $locationProvider.html5Mode(isHtml5Mode);
    $locationProvider.hashPrefix('!');
  });
開發者ID:martin-liu,項目名稱:m-ng-ts,代碼行數:32,代碼來源:config.ts

示例7: function

 request: function(request: any) {
     // Add X-Requested-With header to disable basic auth
     if (angular.isUndefined(request.headers)) {
         request.headers = {};
     }
     request.headers["X-Requested-With"] = "XMLHttpRequest";
     return request;
 },
開發者ID:prashanthc97,項目名稱:kylo,代碼行數:8,代碼來源:AngularHttpInterceptor.ts

示例8:

 $timeout(() => {
     if (
         ngModelCtrl.$modelValue !== null &&
         !angular.isUndefined(ngModelCtrl.$modelValue) &&
         !_.isEmpty(ngModelCtrl.$modelValue[sisaltokieli])
     ) {
         ngModelCtrl.$setViewValue(ngModelCtrl.$modelValue[sisaltokieli]);
     } else {
         ngModelCtrl.$setViewValue("");
     }
     ngModelCtrl.$render();
 });
開發者ID:Opetushallitus,項目名稱:eperusteet,代碼行數:12,代碼來源:muokattavakentta.ts

示例9: function

 ctrl.$render = function() {
     if (editor) {
         if (
             angular.isUndefined(ctrl.$viewValue) ||
             (angular.isString(ctrl.$viewValue) && _.isEmpty(ctrl.$viewValue) && placeholderText)
         ) {
             element.addClass("has-placeholder");
             editor.setData(placeholderText);
             editor.resetDirty();
         } else {
             element.removeClass("has-placeholder");
             editor.setData(ctrl.$viewValue);
         }
     }
 };
開發者ID:Opetushallitus,項目名稱:eperusteet,代碼行數:15,代碼來源:ckeditor.ts

示例10: internal2external

        function internal2external (viewValue) {
          if (angular.isUndefined(viewValue)) {
            return;
          } else if (scope.config.useNullableModel && viewValue === null) {
            return null;
          }

          let modelValue;

          if (scope.config.multiple || scope.config.forceArrayOutput) {
            modelValue = viewValue;
          } else {
            modelValue = viewValue[0];
          }

          return modelValue;
        }
開發者ID:w11k,項目名稱:w11k-select,代碼行數:17,代碼來源:w11k-select.directive.ts


注:本文中的angular.isUndefined函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。