I have a service to load and save templates and want that when I click the ion-select the options are dynamically loaded so that every saved template is an option instead of hardcoded options.
I tried using an NgFor and creating an instance of the service that handles the templates in the JS file.
Here is the HTML code
```
<ion-item>
<ion-label>Load template</ion-label>
<ion-select>
<ion-option *ngFor = "let template of templates;">
{{templates}}
</ion-option>
</ion-select>
</ion-item>
```
Here's the template service code
```
export class TemplateService {
public templates: Template[] = [];
...
getAllTemplates(): Template[] {
return this.templates;
}
```
Here's the JS code
```
export class NewTransactionPage {
templates: Template[];
...
constructor(public templateServicerino: TemplateService) {
this.templates = this.templateServicerino.getAllTemplates();
```
I get an error saying "Uncaught (in promise): Error: StaticInjectorError(AppModule)[NewTransactionPage -> TemplateService: StaticInjectorError(Platform:core)[NewTransactionPage -> TemplateService: NullInjectorError: No provider for Template Service!"
*ngFornotngfor.- HasilT