npm install @tekdi/ngtek-event-library
import { EventLibraryModule } from '@tekdi/ngtek-event-library'; <---
import * as configData from '../environments/urlConfig';<- - -
@NgModule({
declarations: [
AppComponent
],
imports: [
.....
...
EventLibraryModule.forChild(configData), <---
....
],
providers: [ ]
})
export class AppModule { }
urlConfig.ts file in your project root path and addyour api url with respective Key
export const urlConfig = {
detail : "/api/event/v4/read/",
list : "assets/api/eventlist.json",
create: "/api/event/v4/create",
update: "/api/event/v4/update",
formConfig : "assets/api/event-create.json",
ernrolEvents : "assets/api/enroll-list.json",
enroll: "/v1/event/enroll",
retire : "/private/event/v4/retire",
publish: "/event/v4/publish"
};
"assets" : [
{
"glob": "**/*",
"input": "./node_modules/@tekdi/ngtek-event-library/assets/",
"output": "/assets/"
}
]
"styles": [
...
...
"./node_modules/@tekdi/ngtek-event-library/assets/styles/styles.scss",
"node_modules/izitoast/dist/css/iziToast.min.css"
],
"scripts": [
"node_modules/izitoast/dist/js/iziToast.min.js"
]
Feature | Description | Selector | Codes |
---|---|---|---|
Event List | Use for show card list | sb-event-list | <sb-event-list [list]="eventList" (eventDetailData)="navToEventDetail($event) " > |
Event Cover | Use for show event cover data | sb-cover-event-detail | <sb-cover-event-detail [eventDetailItem]="eventItem" (retireEventId)="retire($event)" [userData]="userId" > |
Event Join Button | Use for show event join and enroll button | sb-join-event-button | <sb-join-event-button [eventDetailItem]="eventItem" [userData]="userId" [canUnenroll]="true" > |
Event Advance detail | Use for show more data about event | sb-advance-event-detail | <sb-advance-event-detail [eventDetailItem]="eventItem"> |
Event Create | Use for show event create form | sb-event-create | <sb-event-create *ngIf="!isDetail" [formFieldProperties]="formFieldProperties" [userId]="userId" (closeSaveForm)="cancel($event)" (navAfterSave)="navAfterSave($event);"> |
import { EventListService} from '@tekdi/ngtek-event-library';
Method | Description |
---|---|
getEventList() | This method will Provide a list of events |
import { EventDetailService} from '@tekdi/ngtek-event-library';
Method | Description |
---|---|
getEvent(identifier) | Pass list api config and event Identifier to getEvent method and it will Provide a list of events with given filters |
import { EventCreateService} from '@tekdi/ngtek-event-library';
Method | Description |
---|---|
getEventFormConfig() | function is provide event form configurations |
createEvent(formData) | Pass formData ({Key : value}) to the createEvent method and it will create a new event and return success/error response. |
updateEvent(formData) | Pass formData ({Key : value}) to the updateEvent method and it will create a new event and return success/error response. |
Import {TimezoneCal }from '@tekdi/ngtek-event-library';
Method | Description |
---|---|
calcTime(date, Time) | Pass date and GMT time (Eg: 23:12:04+5.30) format it will return current country/city location in all over word |
timeZoneAbbreviated | Function return the timezone code (eg: IST) |
getTimeOffset() | Return time offset (eg: 5.30) |
Import { SbToastService} from '@tekdi/ngtek-event-library';
Method | Description |
---|---|
showIziToastMsg(message: string, type: string): | Show toast messages Message - Text display to user Type - error/success/warning /info |
destroyIzitoast() | Destroy toast message |
Import { DataService} from '@tekdi/ngtek-event-library';
Method | Description |
---|---|
post(requestParam) | For request post call |
get(requestParam) | For request get call |
RequestParam structure:
const RequestParam = {
url: api-url,
data: requestBody,
header: { 'Content-Type' : 'application/json'}
};
Method | Description |
---|---|
getEnrollEvents() | For get enroll event list |
enrollToEventPost() | To enroll event |
@Input() list: any; Event List Object
@Input() list: any; Event Detail Object
@Output() retireEventId EventEmitter<string>
@Input() userId :any; User Id
@Input() eventDetailItem :any; EventEmitter<string>
@Input() userId :any; User id
Event Form Object
@Output() closeSaveForm EventEmitter<string>
@Output() navAfterSave EventEmitter<string>
(eventDetailData)="navToEventDetail($event)"
Eg:
<sb-event-list (eventDetailData)="navToEventDetail($event) " >
</sb-event-list>
Then
Go to demo-event-list.ts file and insert followingcode:
navToEventDetail(res){
this.router.navigate(['/demo-event-detail]); //add your code here
....
}
(creationCancel)=" functionName ($event)"
Eg:
<sb-event-create [formFieldProperties]="formFieldProperties"
(closeSaveForm)="cancel($event)" ></sb-event-create>
Then
functionName (){
this.router.navigate(['/home']); //add your codehere
}
(navAfterSave)=" functionName ($event)"
Eg:
<sb-event-create ( navAfterSave )="saveData();" ></sb-event-create>
Then
saveData (){
//add your code here
....
}