本文整理汇总了TypeScript中main.module.default类的典型用法代码示例。如果您正苦于以下问题:TypeScript module.default类的具体用法?TypeScript module.default怎么用?TypeScript module.default使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了module.default类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: constructor
import app from 'main.module';
import {ILogger, LoggerService} from 'helpers/logger/logger';
/**
* Displays the SPA shell.
* The shell contains the shared parts of the application: header, footer, navigation...
*/
export class ShellController {
private logger: ILogger;
constructor(private $state: ng.ui.IStateService,
logger: LoggerService) {
this.logger = logger.getLogger('shell');
this.logger.log('init');
}
/**
* Checks if the specified name is contained in the current navigation state.
* @param {string} name The state name to check.
* @return {boolean} True if the specified name is contained in the current navigation state.
*/
stateContains(name: string): boolean {
return _.startsWith(this.$state.current.name, name);
}
}
app.controller('shellController', ShellController);
开发者ID:sinedied,项目名称:hadra-trance-festival,代码行数:30,代码来源:shell.controller.ts
示例2:
$provide.decorator('$log', ($delegate: any) => {
if (!env.debug) {
$delegate.log = angular.noop;
$delegate.debug = angular.noop;
}
return $delegate;
});
// Disable angular debug info in production version
$compileProvider.debugInfoEnabled(env.debug);
$analyticsProvider.developerMode(env.debug);
$analyticsProvider.firstPageview(true);
// Set Soundcloud client ID
plangularConfigProvider.clientId = config.soundCloudClientId;
// Customize markdown compilation
markedProvider.setRenderer({
link: (href, title, text) => {
let isExternal = href.indexOf('http') === 0;
return '<a ' + (isExternal ? 'ng-click="vm.open(\'' + href + '\')"' : 'href="' + href + '"') +
(title ? ' title="' + title + '"' : '') + '>' + text + '</a>';
}
});
}
app.config(mainConfig);
开发者ID:sinedied,项目名称:hadra-trance-festival,代码行数:29,代码来源:main.config.ts
示例3: Logger
export class LoggerService {
constructor(private $log: ng.ILogService) {}
/**
* Gets a customized logger based on the given module name.
* @param {string} moduleName The module name.
* @return {Logger} A logger object.
*/
getLogger(moduleName: string): ILogger {
return new Logger(this.$log, moduleName, log);
}
/**
* Adds a new observer function that will be called for each new log entry.
* These parameters are passed to the observer function, in order:
* - message {string} message The message to be logged.
* - source {?string=} source The source of the log.
* - level {'log'|'info'|'warning'|'error'} level The log level.
* - options {Object?} options Additional log options.
* @param {!function} observerFunc The observer function.
*/
addObserver(observerFunc: IObserverFunction) {
observers.push(observerFunc);
}
}
app.service('logger', LoggerService);
开发者ID:sinedied,项目名称:hadra-trance-festival,代码行数:29,代码来源:logger.ts
示例4: constructor
import app from 'main.module';
import {ILogger, LoggerService} from 'helpers/logger/logger';
export class InfosController {
private logger: ILogger;
constructor(logger: LoggerService) {
this.logger = logger.getLogger('infosController');
this.logger.log('init');
}
}
app.controller('infosController', InfosController);
开发者ID:sinedied,项目名称:hadra-trance-festival,代码行数:15,代码来源:infos.controller.ts
示例5: getId
scene: set.scene.name
}),
data: Set.getSerializableCopyWithId(set),
at: setNotificationDate.toDate(),
});
}
});
});
});
}
private getId() {
let id = this.id++;
this.$window.localStorage.setItem(NOTIFICATION_KEY, '' + this.id);
return id;
}
private onTrigger(event: any, notification: any) {
this.logger.log('notification triggered');
if (this.$rootScope['foreground']) {
this.toastService.show(notification.text);
}
}
}
app.service('notificationService', NotificationService);
开发者ID:sinedied,项目名称:hadra-trance-festival,代码行数:30,代码来源:notification.service.ts
示例6:
import app from 'main.module';
/**
* Wraps external global libraries into AngularJS injection system.
* global window: false
*/
app
.constant('_', _) // Lodash
.constant('moment', moment);
开发者ID:sinedied,项目名称:hadra-trance-festival,代码行数:9,代码来源:main.wrappers.ts
示例7: encodeURIComponent
this.logger.log('Injecting context in: ' + restApi);
if (!context) {
throw 'inject: context must be defined';
}
// Search for context properties to inject
let properties = restApi.match(/(:\w+)/g);
angular.forEach(properties, (property: string) => {
let contextVar = property.substring(1);
let contextValue = context[contextVar];
if (contextValue !== undefined) {
contextValue = encodeURIComponent(contextValue);
restApi = restApi.replace(property, contextValue);
this.logger.log('Injected ' + contextValue + ' for ' + property);
} else {
throw 'inject: context.' + contextVar + ' expected but undefined';
}
});
this.logger.log('Resulting REST API: ' + restApi);
return restApi;
}
}
app.service('contextService', ContextService);
开发者ID:angular-starter-kit,项目名称:generator-angular-pro,代码行数:30,代码来源:context.service.ts
示例8: resetNavBar
});
}
for (let i = 0; i < this.titles.length; ++i) {
let title = angular.element(this.titles[i]);
title.css({
color: 'rgba(255,255,255,0)'
});
}
}
resetNavBar() {
for (let i = 0; i < this.navbars.length; ++i) {
let header = angular.element(this.navbars[i]);
header.css({
borderColor: '',
backgroundImage: '',
backgroundColor: ''
});
}
for (let i = 0; i < this.titles.length; ++i) {
let title = angular.element(this.titles[i]);
title.css({
color: ''
});
}
}
}
app.service('fadingBarService', FadingBarService);
开发者ID:sinedied,项目名称:hadra-trance-festival,代码行数:30,代码来源:fading-bar.service.ts
示例9: init
/**
* Initializes the root controller.
*/
function init() {
// Enable debug mode for translations
gettextCatalog.debugPrefix = 'T_';
gettextCatalog.debug = config.environment.debug;
vm.setLanguage();
// Set REST server configuration
restService.setServer(config.environment.server);
}
/**
* Updates the title.
* @param {?string=} stateTitle Title of current state, to be translated.
*/
function updateTitle(stateTitle?: string) {
vm.pageTitle = gettextCatalog.getString('APP_NAME');
if (stateTitle) {
vm.pageTitle += ' | ' + gettextCatalog.getString(stateTitle);
}
}
}
app.run(main);
开发者ID:sinedied,项目名称:festival-editor,代码行数:29,代码来源:main.run.ts
示例10: fixXScrollWithHandle
fixXScrollWithHandle(handle: string) {
this.$timeout(() => {
let scrollView = this.$ionicScrollDelegate.$getByHandle(handle).getScrollView();
let container = scrollView.__container;
if (!container.__scrollFixed) {
container.__scrollFixed = true;
// Replace original touch handler to allow bubbling up
let originalTouchStart = scrollView.touchStart;
container.removeEventListener('touchstart', scrollView.touchStart);
scrollView.touchStart = (e) => {
// Fake this method to prevent ionic touch hander to stop bubbling up
e.preventDefault = angular.noop;
// For some reasons, this check is needed to avoid an error...
if (originalTouchStart) {
originalTouchStart.apply(scrollView, [e]);
}
};
container.addEventListener('touchstart', scrollView.touchStart, false);
}
});
}
}
app.service('scrollService', ScrollService);
开发者ID:sinedied,项目名称:hadra-trance-festival,代码行数:30,代码来源:scroll.service.ts
注:本文中的main.module.default类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论