# EIAM Favorite-pages

> 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.



## Getting Started

###  Install the component:

> First, install the component in your Angular project:

```bash
1. npm i eiam-favorite-pages


2. Import and define custom elements in your application:
In your main.ts, import and define custom elements:

 import { defineCustomElements } from 'eiam-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:apiUrl, pageTitle, pageId, cultureCode and applicationId to the component:
In your HTML:

 <eiam-favorite-pages
   [apiUrl]="apiUrl"
   [pageTitle]="pageTitle"
   [pageId]="pageId"
   [cultureCode]="cultureCode"
   [applicationId]="applicationId"
   ></eiam-favorite-pages>


In your Angular component, make sure to dynamically provide all required input values. If any value is missing, an error message will be displayed. 

export class YourComponent implements OnInit {
  cultureCode: string;
  applicationId: string;   
  apiUrl :string
  pageTitle :string
  pageId :number
  ngOnInit() {
    // You can update these values.
  }
}


