當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。