@dataclouder/ngx-lessons
v0.1.22
Published
This Angular library provides a set of components and services for building dynamic, interactive language learning lessons within the Polilan application ecosystem. It leverages PrimeNG components for UI elements and follows modern Angular practices (Sign
Readme
@dataclouder/ngx-lessons
This Angular library provides a set of components and services for building dynamic, interactive language learning lessons within the Polilan application ecosystem. It leverages PrimeNG components for UI elements and follows modern Angular practices (Signals, standalone components).
Installation
To install this library in your Angular project, run:
npm install @dataclouder/ngx-lessonsor
yarn add @dataclouder/ngx-lessonsUsage
Import the necessary components or services into your Angular standalone components or modules.
Example (Standalone Component):
import { Component } from '@angular/core';
// Assuming a primary component like LessonDisplayComponent exists and is exported
import { LessonDisplayComponent } from '@dataclouder/ngx-lessons';
@Component({
selector: 'app-my-lesson-page',
standalone: true,
imports: [LessonDisplayComponent], // Import the lesson component
template: `
<h2>My Lesson</h2>
<dc-lesson-display [lessonId]="currentLessonId"></dc-lesson-display>
`,
})
export class MyLessonPageComponent {
currentLessonId = 'lesson-1';
// ... component logic
}(Note: Replace LessonDisplayComponent and dc-lesson-display with the actual primary component exported by the library if different.)
Key Features
- Dynamic Lesson Rendering: Renders different types of lesson interactions based on configuration.
- Component Builder: Facilitates the creation and configuration of lesson components.
- Core Interfaces: Provides
ILesson,LessonComponentConfiguration, etc., for defining lesson structures. - PrimeNG Integration: Uses PrimeNG components for a consistent UI.
Code Scaffolding (Development within this library)
Run ng generate component component-name --project @dataclouder/ngx-lessons to generate a new component within this library project. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project @dataclouder/ngx-lessons.
Note: Don't forget to add
--project @dataclouder/ngx-lessonsor else it will be added to the default project in yourangular.jsonfile.
Build
Run ng build @dataclouder/ngx-lessons to build the project. The build artifacts will be stored in the dist/dataclouder/ngx-lessons directory.
Publishing
After building your library with ng build @dataclouder/ngx-lessons, go to the dist folder cd dist/dataclouder/ngx-lessons and run npm publish.
Running unit tests
Run ng test @dataclouder/ngx-lessons to execute the unit tests via Jest.
Further help
To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.
