当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript core.isDevMode函数代码示例

本文整理汇总了TypeScript中@angular/core.isDevMode函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isDevMode函数的具体用法?TypeScript isDevMode怎么用?TypeScript isDevMode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了isDevMode函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: constructor

  constructor(
    private ngRedux: NgRedux<IAppState>,
    private devTool: DevToolsExtension) {

    // configure the store here, this is where the enhancers are set
    this.ngRedux.configureStore(rootReducer, {},
      isDevMode() ? [createLogger({ collapsed: true })] : [],
      isDevMode() && devTool.isEnabled() ? [...enhancers, devTool.enhancer()] : [...enhancers]);
  }
开发者ID:projectSHAI,项目名称:expressgular2,代码行数:9,代码来源:redux.module.ts

示例2: assertInterpolationSymbols

export function assertInterpolationSymbols(identifier: string, value: any): void {
  if (isDevMode() && !isBlank(value) && (!isArray(value) || value.length != 2)) {
    throw new BaseException(`Expected '${identifier}' to be an array, [start, end].`);
  } else if (isDevMode() && !isBlank(value)) {
    const start = value[0] as string;
    const end = value[1] as string;
    // black list checking
    INTERPOLATION_BLACKLIST_REGEXPS.forEach(regexp => {
      if (regexp.test(start) || regexp.test(end)) {
        throw new BaseException(`['${start}', '${end}'] contains unusable interpolation symbol.`);
      }
    });
  }
}
开发者ID:JohnRights,项目名称:angular,代码行数:14,代码来源:assertions.ts

示例3:

        return this.accountService.identity().then(account => {
            if (!authorities || authorities.length === 0) {
                return true;
            }

            if (account) {
                const hasAnyAuthority = this.accountService.hasAnyAuthority(authorities);
                if (hasAnyAuthority) {
                    return true;
                }
                if (isDevMode()) {
                    console.error('User has not any of required authorities: ', authorities);
                }
                return false;
            }

            this.stateStorageService.storeUrl(url);
            this.router.navigate(['accessdenied']).then(() => {
                // only show the login dialog, if the user hasn't logged in yet
                if (!account) {
                    this.loginModalService.open();
                }
            });
            return false;
        });
开发者ID:Danils123,项目名称:Prueba-azure,代码行数:25,代码来源:user-route-access-service.ts

示例4: _createConditionalRootRenderer

export function _createConditionalRootRenderer(
    rootRenderer: any /** TODO #9100 */, extraTokens: NgProbeToken[]) {
  if (isDevMode()) {
    return _createRootRenderer(rootRenderer, extraTokens);
  }
  return rootRenderer;
}
开发者ID:JanStureNielsen,项目名称:angular,代码行数:7,代码来源:ng_probe.ts

示例5: notify

export function notify(message: string): void {
  if (!isDevMode() || message in notifications) {
    return;
  }
  notifications[message] = true;
  console.warn(message); // tslint:disable-line
}
开发者ID:bullhorn,项目名称:novo-elements,代码行数:7,代码来源:notifier.util.ts

示例6: showMessage

export function showMessage(message: string, isMessageShown: boolean): boolean {
    if (!isMessageShown && isDevMode()) {
        console.warn(message);
    }

    return true;
}
开发者ID:IgniteUI,项目名称:igniteui-angular,代码行数:7,代码来源:deprecateDecorators.ts

示例7: canActivate

 canActivate(route: ActivatedRouteSnapshot): boolean {
   if (!(isDevMode()) && (location.protocol !== 'https:')) {
     location.href = 'https:' + window.location.href.substring(window.location.protocol.length);
     return false;
   }
   return true;
 }
开发者ID:rulerofthedeities,项目名称:aandevesten,代码行数:7,代码来源:issecure-guard.service.ts

示例8: sanitizeUrl

export function sanitizeUrl(url: string): string {
  url = String(url);
  if (url.match(SAFE_URL_PATTERN) || url.match(DATA_URL_PATTERN)) return url;

  if (isDevMode()) getDOM().log('WARNING: sanitizing unsafe URL value ' + url);

  return 'unsafe:' + url;
}
开发者ID:BahKoo,项目名称:angular,代码行数:8,代码来源:url_sanitizer.ts

示例9: ngAfterViewInit

  ngAfterViewInit() {
    if (!isDevMode() || !this._platform.isBrowser) {
      return;
    }

    this._checkToolbarMixedModes();
    this._toolbarRows.changes.subscribe(() => this._checkToolbarMixedModes());
  }
开发者ID:ravichandra480,项目名称:material2,代码行数:8,代码来源:toolbar.ts

示例10: warnOnce

export function warnOnce(msg: string): void {
  if (!isDevMode() || _hideMsg || msg in _messagesHash) {
    return;
  }

  _messagesHash[msg] = true;
  /*tslint:disable-next-line*/
  console.warn(msg);
}
开发者ID:kekeh,项目名称:ngx-bootstrap,代码行数:9,代码来源:warn-once.ts


注:本文中的@angular/core.isDevMode函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。