I have after ngOnInit 2 vars available items and title, items is for the view, i want to "execute" the setSeoTitle() function for the in the index.html, how can i achieve this?
items = [];
title = [];
ngOnInit() {
this.dataService.fetchData(this.slug)
.subscribe(
(data) => {
this.items = data;
this.title = data;
}
);
}
setSeoTitle(item){
this.seoService.setTitle(item[0]['title']);
}