• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript common.registerLocaleData函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: registerLocaleData

import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { registerLocaleData } from '@angular/common';
import { NgModule, LOCALE_ID } from '@angular/core';
import { PerfumeModule } from 'perfume.js/angular';

import localePl from '@angular/common/locales/pl';

registerLocaleData(localePl, 'pl');

import { PogodaModule } from './pogoda/pogoda.module';
import { AppComponent } from './app.component';
import { HttpClientModule } from '@angular/common/http';
import { ServiceWorkerModule } from '@angular/service-worker';
import { MatSnackBarModule } from '@angular/material';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    PerfumeModule.forRoot({
      firstContentfulPaint: true,
      timeToInteractive: true,
      firstInputDelay: true,
      firstPaint: true,
      googleAnalytics: {
        enable: true,
        timingVar: 'perf'
      }
开发者ID:skalagi,项目名称:pogoda-cli,代码行数:31,代码来源:app.module.ts


示例2: registerLocaleData

  SyncOutline,
  MinusOutline,
  FileTextOutline,
  FullscreenOutline,
  ArrowsAltOutline,
  ReloadOutline,
  DownloadOutline,
  ShrinkOutline,
  PicCenterOutline
} from '@ant-design/icons-angular/icons';

import { StatusService } from 'services';
import { ConfigurationInterface } from 'interfaces';
import { AppInterceptor } from './app.interceptor';

registerLocaleData(en);

export function AppInitServiceFactory(
  statusService: StatusService,
  injector: Injector
): () => Promise<ConfigurationInterface> {
  return () => {
    return statusService.boot(injector.get<Router>(Router));
  };
}

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, AppRoutingModule, NgZorroAntdModule, FormsModule, HttpClientModule, BrowserAnimationsModule],
  providers: [
    {
开发者ID:StephanEwen,项目名称:incubator-flink,代码行数:31,代码来源:app.module.ts


示例3: beforeAll

 beforeAll(() => {
   registerLocaleData(localeEn);
   registerLocaleData(localeEsUS);
   registerLocaleData(localeFr);
 });
开发者ID:asself,项目名称:angular,代码行数:5,代码来源:number_pipe_spec.ts


示例4: constructor

 constructor() {
     registerLocaleData(locale);
 }
开发者ID:pmarrupe,项目名称:ApiGateWay,代码行数:3,代码来源:shared-common.module.ts


示例5: registerLocaleData

import { NgModule } from '@angular/core';
import { CommonModule, registerLocaleData } from '@angular/common';
import { WrapperChauffeurComponent } from './wrapper-chauffeur/wrapper-chauffeur.component';
import { RouterModule, Routes } from '@angular/router';
import { SharedModule } from '../shared/shared.module';
import { PlanningComponent } from './planning/planning.component';
import { OccupationComponent } from './occupation/occupation.component';
import localeFr from '@angular/common/locales/fr';
import { CalendarModule } from 'angular-calendar';
import { DataService } from './data.service';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { JwtInterceptor } from '@auth0/angular-jwt';

registerLocaleData(localeFr);

const chauffeurRoutes: Routes = [
  {
    path: '',
    component: WrapperChauffeurComponent,
    children: [
      { path: 'planning', component: PlanningComponent },
      { path: 'occupation', component: OccupationComponent },
      { path: '', redirectTo: 'planning' }
    ]
  }
];
@NgModule({
  imports: [
    CommonModule,
    RouterModule.forChild(chauffeurRoutes),
    SharedModule,
开发者ID:thienban,项目名称:gestion-du-transport,代码行数:31,代码来源:chauffeur.module.ts


示例6: registerLocaleData

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
import { NgZorroAntdModule, NZ_I18N, zh_CN } from 'ng-zorro-antd';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { registerLocaleData } from '@angular/common';
import zh from '@angular/common/locales/zh';
import { BannerComponent } from './banner/banner.component';
import {LayoutComponent} from "./layout/layout.component";

registerLocaleData(zh);

@NgModule({
  declarations: [
    AppComponent,
    HomeComponent,
    BannerComponent,
    LayoutComponent
  ],
  imports: [
    BrowserModule,
    NgZorroAntdModule,
    FormsModule,
    HttpClientModule,
    BrowserAnimationsModule
  ],
  providers: [{ provide: NZ_I18N, useValue: zh_CN }],
开发者ID:mycard,项目名称:mycard-store,代码行数:31,代码来源:app.module.ts


示例7: registerLocaleData

import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

// #region default language
// 参考:https://ng-alain.com/docs/i18n
import { default as ngLang } from '@angular/common/locales/zh-Hans';
import { NZ_I18N, zh_CN as zorroLang } from 'ng-zorro-antd';
import { DELON_LOCALE, zh_CN as delonLang } from '@delon/theme';
const LANG = {
  abbr: 'zh-Hans',
  ng: ngLang,
  zorro: zorroLang,
  delon: delonLang,
};
// register angular
import { registerLocaleData } from '@angular/common';
registerLocaleData(LANG.ng, LANG.abbr);
const LANG_PROVIDES = [
  { provide: LOCALE_ID, useValue: LANG.abbr },
  { provide: NZ_I18N, useValue: LANG.zorro },
  { provide: DELON_LOCALE, useValue: LANG.delon },
];
// #endregion

// #region JSON Schema form (using @delon/form)
import { JsonSchemaModule } from '@shared/json-schema/json-schema.module';
const FORM_MODULES = [JsonSchemaModule];
// #endregion


// #region Http Interceptors
import { HTTP_INTERCEPTORS } from '@angular/common/http';
开发者ID:jijiechen,项目名称:openaspnetorg,代码行数:31,代码来源:app.module.ts


示例8: registerLocaleData

 * Copyright (c) 2016-2018 VMware, Inc. All Rights Reserved.
 * This software is released under MIT license.
 * The full license information can be found in LICENSE in the root directory of this project.
 */
import {registerLocaleData} from "@angular/common";
import localeAk from "@angular/common/locales/ak";
import localeAr from "@angular/common/locales/ar-AE";
import localeDe from "@angular/common/locales/de";
import localeFr from "@angular/common/locales/fr";
import localeHi from "@angular/common/locales/hi";
import localeHR from "@angular/common/locales/hr";
import localeKKJ from "@angular/common/locales/kkj";
import localeRu from "@angular/common/locales/ru";
import {Component} from "@angular/core";

registerLocaleData(localeFr);
registerLocaleData(localeRu);
registerLocaleData(localeAk);
registerLocaleData(localeHi);
registerLocaleData(localeAr);
registerLocaleData(localeDe);
registerLocaleData(localeKKJ);
registerLocaleData(localeHR);

@Component({
    selector: "clr-datepicker-demo",
    // Note the .css extension here, not .scss. That's the best we can have at the moment.
    styleUrls: ["./datepicker.demo.scss"],
    templateUrl: "./datepicker.demo.html"
})
export class DatepickerDemo {}
开发者ID:beqom,项目名称:clarity,代码行数:31,代码来源:datepicker.demo.ts


示例9: fixedLocale

function fixedLocale() {
    localeZhHans[0] = 'zh-CN';
    registerLocaleData(localeZhHans, localeZhHansExtra);
}
开发者ID:staneee,项目名称:ABPTemplateUI-ng-alain,代码行数:4,代码来源:root.module.ts


示例10: registerLocaleData

import { DeveloperCenterModule } from './dev-center/dev-center.module';
import { registerLocaleData } from '@angular/common';

import { TranslateService } from "@ngx-translate/core";
import { AppConfigService } from './app-config.service';
import { SkinableConfig } from "./skinable-config.service";
import { ProjectConfigComponent } from './project/project-config/project-config.component';

import zh from '@angular/common/locales/zh-Hans';
import es from '@angular/common/locales/es';
import localeFr from '@angular/common/locales/fr';
import { DevCenterComponent } from './dev-center/dev-center.component';
import { VulnerabilityPageComponent } from './vulnerability-page/vulnerability-page.component';
import { GcPageComponent } from './gc-page/gc-page.component';
import { OidcOnboardModule } from './oidc-onboard/oidc-onboard.module';
registerLocaleData(zh, 'zh-cn');
registerLocaleData(es, 'es-es');
registerLocaleData(localeFr, 'fr-fr');


export function initConfig(configService: AppConfigService, skinableService: SkinableConfig) {
    return () => {
        skinableService.getCustomFile();
        configService.load().subscribe();
    };
}

export function getCurrentLanguage(translateService: TranslateService) {
    return translateService.currentLang;
}
开发者ID:reasonerjt,项目名称:harbor,代码行数:30,代码来源:app.module.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript common.AbstractControl类代码示例发布时间:2022-05-28
下一篇:
TypeScript common.isPlatformServer函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap