本文整理汇总了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;未经允许,请勿转载。 |
请发表评论