Hello,
I am using a custom Page decorator that extends the functionality of the standard Component.
This worked well until the introduction of relative paths for templateUrl:
If I do this in src/my_page.ts:
import {Page} from './path/to/page';
@Page({
templateUrl: 'foo.html'
})
class Foo{}
the template is not searched in the src folder, but in the www folder (if I create www/foo.html it works). I found a workaround for this (creating a symbolic link inside www to src), but this causes trouble elsewhere. Is there a way to make relative urls possible when using a custom Page decorator? Alternatively: How can I activate absolute paths again, such that I can specify the templateUrl relative to the root of the src/ directory?
I already tried a lot of things like setting moduleId manually (doesn’t work, neither with webpack nor with rollup) but I can’t find a solution
Thank you in advance!
Edit: My custom Page decorator looks like this:
export function Page(options: any = {}) {
if (!options.changeDetection) {
options.changeDetection = ChangeDetectionStrategy.OnPush;
}
return function(target) {
target.prototype.ionViewWillEnter = function() {
if (_redirect) {
this.nav.push(_redirect[0], _redirect[1]);
_redirect = undefined;
}
}
Component(options)(target);
}
}