Ionic notification customizing

i am trying to build a mobile application which get data from an api and push the data in a notification,the problem that i want to customize my notification by adding the title dynamically in the index.html file and not in the home.ts file.

here is the code

public schedule() {

LocalNotifications.schedule({
    title: "",
    text: "",
    at: new Date(new Date().getTime() + 1* 1000),
    sound: null
});

}

any proposed solution?

Not sure what you mean by "adding the title dynamically in the index.html".

You can use Angular’s Http service to communicate with your API, and after you’ve fetched the data you can go ahead and schedule the notification.

how can i do that?

button primary (click)=“schedule(“title”:“something”)”>Schedule/button>

<button ion-button (click)="schedule('Hello world', 'Hello universe')">Schedule</button>
schedule(title, text) {
  LocalNotifications.schedule({
    title,
    text,
    at: new Date()
  }).catch(e => console.log('Error schedling notification', e);
}