{"id":50683119,"url":"https://github.com/worldskills/worldskills-angular-lib","last_synced_at":"2026-06-08T20:31:46.157Z","repository":{"id":38459302,"uuid":"171627461","full_name":"worldskills/worldskills-angular-lib","owner":"worldskills","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-15T09:31:54.000Z","size":66632,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-05-15T09:38:12.091Z","etag":null,"topics":["library"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/worldskills.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-02-20T07:59:21.000Z","updated_at":"2026-03-09T15:31:50.000Z","dependencies_parsed_at":"2024-05-28T14:19:08.972Z","dependency_job_id":"911e9be4-71ee-42b7-a791-e05618a2b85a","html_url":"https://github.com/worldskills/worldskills-angular-lib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/worldskills/worldskills-angular-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldskills%2Fworldskills-angular-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldskills%2Fworldskills-angular-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldskills%2Fworldskills-angular-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldskills%2Fworldskills-angular-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/worldskills","download_url":"https://codeload.github.com/worldskills/worldskills-angular-lib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldskills%2Fworldskills-angular-lib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34080025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library"],"created_at":"2026-06-08T20:31:43.008Z","updated_at":"2026-06-08T20:31:46.151Z","avatar_url":"https://github.com/worldskills.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WorldSkills Angular Library\n\nThis project is library of common functionality that supports the development of WorldSkills applications.\n\n## Versioning guidelines\nThe versioning is divided into 3 parts. MAJOR, MINOR, and PATCH.  \n- The Major version is incremented when a breaking change occurs (in this case the library is not backward compatible)\n- the Minor version is incremented when we add new functionality in a backward compatible manor.\n- The PATCH version is incremented when we perform bug fixes, and the changes are backward comptible.\n\n## Changelog\n\nNotable changes can be viewed [here](https://github.com/worldskills/worldskills-angular-lib/blob/master/changelog.md).\n\n## Setup\nInsert the following entry into your `local API_AUTH`\n```\nINSERT INTO client_application\n(name, created_by, client_key, secret, requires_authorization, redirect_uri, logout_redirect_uri, can_perform_authentication, grant_type)\nVALUES\n('WorldSkills Angular Lib', 'WorldSkills International', '6321532f6771', '211b2c58-5dbd-4dca-b4e4-fb506d10972b', 'N', 'http://localhost:4200/home', 'http://localhost:4200/home', 'N', 'IMPLICIT')\n```\n\n## Usage examples\n\nExamples of how library components work can be viewed [here](https://github.com/worldskills/worldskills-angular-lib/blob/main/usage.md).\n\n## Development server\n\nRun `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.\n\n## Code scaffolding\n\nRun `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.\n\n## Build\n\nRun `npm run ws_build_lib` to build the project. The build artifacts will be stored in the `dist/` directory.\n\n## Packaging\n\nRun `npm run ws_npm_pack` to create the tgz package (a node module) in the `dist/worldskills-angular-lib` directory.\n\n## Build \u0026 Package together\n\nRun `npm run ws_package`\n\n## Publishing\n\nWe publish our packages on [npmjs](https://www.npmjs.com/) under the *WorldSkills* organization, [here](https://www.npmjs.com/package/@worldskills/worldskills-angular-lib).\nAfter building and packaging, go to the dist folder `cd dist/worldskills-angular-lib` and run `npm publish`.\n\n## Running unit tests\n\nRun `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).\n\n## Running end-to-end tests\n\nRun `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).\n\n## Further help\n\nTo get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).\n\n## Getting Started\n\n### package installaion\n\nonce you've set up a new angular application install the following libraries:  \n`ng add @ng-bootstrap/ng-bootstrap`  \n`npm i angular-oauth2-oidc`  \n`npm i popper.js`  \n`npm i angular-font-awesome`  \n`npm i ng-select`  \n`npm i @worldskills/bootstrap`  \n`npm i @worldskills/worldskills-angular-lib`\n\n### Styling\n\nAdd the following line to an applications `styles.css`  \n`@import \"~@ng-select/ng-select/themes/default.theme.css\";`  \n`@import \"~@worldskills/worldskills-angular-lib/assets/styles/index.css\";`  \n\n### app.module.ts\n\nadd the following import statement into your app.module.ts  \n`import { WorldskillsAngularLibModule, WsHttpInterceptor } from '@worldskills/worldskills-angular-lib';`  \n\nensure the following modules are within the `import: { ... }` section of your app.module.ts  \n\n```TypeScript\n\nexport const appTranslationConfig = TranslateModule.forRoot({\n  loader: provideTranslateHttpLoader({\n    prefix: \"/assets/i18n/\",\n    suffix: \".json\",\n    enforceLoading: true,\n    useHttpBackend: true,\n  }),\n  isolate: true, // isolate property is the key point to remember/\n});\n\n@NgModule({\n  declarations: [\n    AppComponent,\n    // your components\n  ],\n  imports: [\n    BrowserModule,\n    FormsModule,\n    HttpClientModule,\n    OAuthModule.forRoot(),\n    RouterModule.forRoot(appRoutes, routerOptions),\n    appTranslationConfig,\n    WorldskillsAngularLibModule,\n    NgbModule,\n    NgSelectModule\n  ],\n  providers: [\n    { provide: HTTP_INTERCEPTORS, useClass: WsHttpInterceptor, multi: true },\n  ],  bootstrap: [AppComponent]\n})\nexport class AppModule {\n}\n```\n\nfor Standalone apps, you do not have an AppModule, you need to do this in the `appConfig` instead\nensure the following modules are within the `importProvidersFrom: { ... }` section of your app.config.ts  \n\n```TypeScript\nexport function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {\n  return new TranslateHttpLoader(http);\n}\n\nexport const appTranslationConfig = TranslateModule.forRoot({\n  loader: {\n    provide: TranslateLoader,\n    useFactory: HttpLoaderFactory,\n    deps: [HttpClient],\n  },\n  isolate: true, // isolate property is the key point to remember/\n});\n\nexport const appConfig: ApplicationConfig = {\n  providers: [\n    provideZoneChangeDetection({ eventCoalescing: true }),\n    provideRouter(routes),\n    importProvidersFrom(\n      appTranslationConfig,\n      WorldskillsAngularLibModule.forRoot({})\n    ),\n  ],\n};\n```\n\n### configure the module\n\nAdd the following to your `app.component.ts` to configure teh module.\nAll configuration is optional. this example provides a full set of what's available.\ncalling the `next()` method of a config type propogates that config to the module\n\n```TypeScript\nconstructor(private wsi: WorldskillsAngularLibService) {\n}\nngOnInit() {\n    const appConfig = this.wsi.appConfigSubject.getValue();\n    appConfig.notAuthorizedRoute = ['/not-authorized'];\n    this.wsi.appConfigSubject.next(appConfig);\n\n    this.wsi.authConfigSubject.next({\n        loginUrl: 'http://localhost:50300/oauth/authorize',\n        clientId: '7221138f6772',\n        redirectUri: 'http://localhost:4200/home',\n        userinfoEndpoint: 'http://localhost:8081/users/loggedIn?show_child_roles=false\u0026app_code=500',\n        oidc: false\n    });\n\n    const httpConfig = this.wsi.httpConfigSubject.getValue();\n    httpConfig.encoderUriPatterns = [];\n    httpConfig.authUriPatterns = ['http://localhost:8081'];\n    this.wsi.httpConfigSubject.next(httpConfig);\n\n    const serviceConfig = this.wsi.serviceConfigSubject.getValue();\n    serviceConfig.appCode = [500];\n    serviceConfig.apiEndpoint = 'http://localhost:8081';\n    this.wsi.serviceConfigSubject.next(serviceConfig);\n}\n```\n\n### http auth injector\n\nThe WSHttpInjector will extract the current auth token and inject into in future web requests that match the patterns specified in the httpConfig object.  \nensure the following provider is added within the `providers: { ... }` section of your app.module.ts  \n`{ provide: HTTP_INTERCEPTORS, useClass: WsHttpInterceptor, multi: true }`\n\n## Extending the library\n\nWhen extending the library follow theese guidelies:\n\n- We've taken a somewhat `feature` design to the approach.\n  - What this means is that eacch folder in the library source `(/src/lib)` is it's own feature.\n  - the only exception is the `common` folder.\n- The common folder contains `shared code` that would be useful to all features.\n- Features may sometimes depend on classes other features, an example would be the `entity-tree-select` feature whicch depends on models from Auth.\n- When you creating a new module, it's alright to keep it self-contained until fully developped then common code can be identified and moved to the `common` folder.\n- We follow the one-class per file rule. exceptions can be made where it is sensible.\n- When creating a new service that requires config. please hook onto the config cchange event in your service constructor\n\n### Hooking onto the config change events\n\n```TypeScript\nthis.wsi.serviceConfigSubject.subscribe(\n  next =\u003e {\n    this.appCode = next.appCode;\n    this.endpoint = next.apiEndpoint + '/auth';\n  }\n);\n```\n\n## Translations\n\n- i18n translations are lazy loaded via json files in `/assets/i18n/lazy-loaded`\n- translationns are issolated so they will not overwrite app transslations\n\n### Upadding translatioons\n\n- the `.json` files mainly exist to support weblate\n- the `json.ts` files are required to transslations to work at a lib level (thiss is a workaround for now)\n- regardless of how the translations are uopdated, we still needd to publissh a new versionn of the lib.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworldskills%2Fworldskills-angular-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworldskills%2Fworldskills-angular-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworldskills%2Fworldskills-angular-lib/lists"}