本文整理汇总了TypeScript中angular.ILogService.debug方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ILogService.debug方法的具体用法?TypeScript ILogService.debug怎么用?TypeScript ILogService.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular.ILogService
的用法示例。
在下文中一共展示了ILogService.debug方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: return
return (str: string, regExStr: string, replaceValue: string) => {
if (!isDefined(regExStr)) {
$log.debug(`Did not supply regex string for 'replace' filter.`);
return str;
} else if (!isDefined(replaceValue)) {
$log.debug(`Did not supply replacement value for 'replace' filter.`);
return str;
} else {
return str.replace(new RegExp(regExStr, 'g'), replaceValue);
}
};
示例2: resumeScheduler
const watchDocumentVisibility = (): void => {
this.$log.debug('document visibilityState changed to: ', document.visibilityState);
if (document.visibilityState === 'visible') {
resumeScheduler();
} else {
suspendScheduler();
}
};
示例3: Date
const resumeScheduler = (): void => {
suspended = false;
const now = new Date().getTime();
this.$log.debug('auto refresh resumed');
if (now - lastRunTimestamp > pollSchedule) {
run();
} else {
scheduleNextRun(pollSchedule - (now - lastRunTimestamp));
}
};
示例4:
const subscription = $uiRouter.globals.start$.subscribe((transition: Transition) => {
const details = {
transition: transition,
toState: transition.to(),
toParams: transition.params('to'),
fromState: transition.from(),
fromParams: transition.params('from'),
};
$log.debug('$stateChangeStart', details);
const success = () => $log.debug('$stateChangeSuccess', details);
const failure = (error: any) => $log.debug('$stateChangeError', Object.assign(details, { error }));
transition.promise.then(success, failure);
});
示例5: run
export function run(
$log: ILogService,
$rootScope: IRootScopeService,
$timeout: ITimeoutService
) {
$log.debug('app module - run');
$rootScope.$on('$stateChangeStart',
function (event: ng.IAngularEvent, toState) {
$log.debug('$stateChangeStart - name:', toState.name);
});
$rootScope.$on('$stateChangeSuccess',
function (event, toState) {
$log.debug('$stateChangeSuccess - name:', toState.name);
});
$rootScope.$on('$stateNotFound',
function (event, unfoundState, fromState, fromParams) {
$log.warn('$stateNotFound', {
event: event,
unfoundState: unfoundState,
fromState: fromState,
fromParams: fromParams
});
});
$rootScope.$on('$stateChangeError',
function (event, toState, toParams, fromState, fromParams, error) {
$log.error('$stateChangeError', {
event: event,
toState: toState,
toParams: toParams,
fromState: fromState,
fromParams: fromParams,
error: error
});
if (error) {
throw error;
}
});
};
示例6:
const failure = (error: any) => $log.debug('$stateChangeError', { ...details, error });
示例7:
const suspendScheduler = (): void => {
this.$log.debug('auto refresh suspended');
suspended = true;
};
示例8: function
function (event, toState) {
$log.debug('$stateChangeSuccess - name:', toState.name);
});