Hi all,
Yes this questions is asked several times on the internet. However I did not succeed in finding a good solution. I want to get the template url from the navparams.
So the best solution for me would be that I could extract some string from the navparams. This string would be the template url. I would then set the template url in the @component decorator and so the app knows which template it should use. Unfortunately this doesn’t work…
import {Component} from '@angular/core';
@Component({
selector: 'page-data-list',
templateUrl: this.navParams.get('templateUrl')
})
export class DataListPage {
items: any;
/**
* Constructor.
* @param navCtrl
* @param dataService
* @param navParams
*/
constructor(public navParams: NavParams) {
}
}
The error that is thrown says that the this
keyword is undefined.
Anyone has an idea how to solve this problem?