本文整理汇总了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);
}
示例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;
}
};
示例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;
};
示例4: isNull
/**
* 判断是否为空
* @param data 数据
*/
public isNull (data){
if(data == null || data == '' || angular.isUndefined(data)){
return true;
}else{
return false;
}
}
示例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);
});
},
示例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('!');
});
示例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;
},
示例8:
$timeout(() => {
if (
ngModelCtrl.$modelValue !== null &&
!angular.isUndefined(ngModelCtrl.$modelValue) &&
!_.isEmpty(ngModelCtrl.$modelValue[sisaltokieli])
) {
ngModelCtrl.$setViewValue(ngModelCtrl.$modelValue[sisaltokieli]);
} else {
ngModelCtrl.$setViewValue("");
}
ngModelCtrl.$render();
});
示例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);
}
}
};
示例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;
}