adobe / aem-angular-editable-components

SPA Angular Editable Components for Adobe Experience Manager
Apache License 2.0
16 stars 11 forks source link

Support for redirectTarget #25

Closed voghan closed 4 years ago

voghan commented 4 years ago

I'm working on an Angular SPA prject and I have not found a work around for pages setup in AEM as directs. We have a couple pages that are used for organizing child pages. The parent page redirects to one of the child pages but it seems the SPA editor routing strategy doesn't support redirecting routes.

niekraaijmakers commented 4 years ago

Okay, I don't know too much about Angular etc, but can we get a bit more information on this.. some screenshots from the model JSON etc, maybe a little bit of the project source code where the routing is used etc?

voghan commented 4 years ago

So I ended up solving my problem. I've updated page.component.ts to include a check for redirect target in page properties.

this.modelManagerService .getData({ path: this.route.snapshot.data.path }) .then(data => { this.path = data[Constants.PATH_PROP]; this.items = data[Constants.ITEMS_PROP]; this.itemsOrder = data[Constants.ITEMS_ORDER_PROP]; this.redirectTarget = data[this.REDIRECT_PATH]; if (this.redirectTarget) { this.router.navigate([this.redirectTarget.page.path]); } });

pfauchere commented 4 years ago

For an improvement related to the current issue to make it to the SDK, we would need more info.