ngx-favorite-pages
Version:
Stencil Component Starter
62 lines (41 loc) • 1.47 kB
Markdown
> This is an Angular component for managing favorite pages, which allows users to:
- Add the current page as a favorite for the logged-in user.
- Display a bar with all favorite pages for the logged-in user.
- Edit and delete favorite page names.
> First, install the component in your Angular project:
```bash
1. npm install favorite-page
2. Import and define custom elements in your application:
In your main.ts, import and define custom elements:
import { defineCustomElements } from 'ngx-favorite-pages/loader';
defineCustomElements(window);
3. import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
@NgModule({
declarations: [...],
imports: [...],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule {}
4. Now you can use the custom elements in your HTML BUT you need to pass the dynamic properties: cultureCode and applicationId to the component:
In your HTML:
<favorite-pages
[]="apiUrl"
[]="pageTitle"
[]="pageId"
[]="cultureCode"
[]="applicationId"
></favorite-pages>
In your Angular component, you can set these values dynamically:
export class YourComponent implements OnInit {
cultureCode: string;
applicationId: string;
apiUrl :string
pageTitle :string
pageId :number
ngOnInit() {
// You can update these values based on user preferences, etc.
}
}