cc-angular-library
v1.0.24
Published
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.0.0.
Readme
Cc-Angular-Components
This library was generated with Angular CLI version 17.0.0.
this project is a collection of components that I have created for my own use. I have decided to make them available to the public.
Translations
to use the translations in your app, you need to add the following steps:
- attach the translation files to your assets folder. to do this, you need to add the following code to your angular.json file.
"assets": [
"src/favicon.ico",
"src/assets",
{
"glob": "**/*.json",
"input": "node_modules/cc-angular-library/assets/",
"output": "/assets/"
}
],- add the translation module to your app. if you are using the standalone app, you need to add the following code to your app.config.ts file.
import {HttpBackend, HttpClientModule} from "@angular/common/http";
import {TranslateLoader, TranslateModule, MissingTranslationHandler } from '@ngx-translate/core';
import {DefaultMissingTranslationHandler, DynamicFormService, MultiTranslateHttpLoader} from "cc-angular-library";
export function createTranslateLoader(http: HttpBackend) {
return new MultiTranslateHttpLoader(http, ['assets/i18n/core','assets/i18n/app']);
}
export const appConfig: ApplicationConfig = {
providers: [
provideRouter(routes),
importProvidersFrom(HttpClientModule),
importProvidersFrom(TranslateModule.forRoot({
missingTranslationHandler: {provide: MissingTranslationHandler, useClass: DefaultMissingTranslationHandler},
loader: {
provide: TranslateLoader,
useFactory: createTranslateLoader,
deps: [HttpBackend]
}
})),
]
};
- add this code to your app.component.ts file.
import {TranslateService} from "@ngx-translate/core";
export class AppComponent {
constructor(private translateService: TranslateService) {
this.translateService.setDefaultLang('he');
this.translateService.use('he');
}
}Styles
to use the styles in your app, you need to add the following steps:
- add the code in your styles.scss file.
@import "../node_modules/cc-angular-library/lib/theme/style/index.scss";-or- 2. add the code in your angular.json file.
"styles": [
"node_modules/cc-angular-library/lib/theme/style/index.scss",
"src/styles.scss"
],buy me a coffee if you like them.
