


Hi,
I am using AEM 6.5 and following the tutorial https://experienceleague.adobe.com/docs/experience-manager-learn/spa-angular-tutorial. However after adding custom-component to the page on adding the value I am getting Invalid recursion selector value.
I also checked out the source code from https://github.com/adobe/aem-guides-wknd-spa.git but on deploying it to my AEM instance I am still getting the same issue.
Since I am new to AEM I am not able to resolve it.
Views
Replies
Sign in to like this content
Total Likes
Hi,
I am unable to open the first link, but based on the error it could be that the resourceType resolution is failing? eg pointing to a page instead of page/jcr:content
Hi,
I am unable to open the first link, but based on the error it could be that the resourceType resolution is failing? eg pointing to a page instead of page/jcr:content
Check your custom component for the selector which you are trying to use is not getting resolved.
If u can add ur custom component code then we can help u out more
@Ankur_Khare below is the code for custom component java class:
import org.apache.sling.models.annotations.*;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;
import com.adobe.cq.export.json.ComponentExporter;
import com.adobe.cq.export.json.ExporterConstants;
import org.apache.commons.lang3.StringUtils;
import org.apache.sling.api.SlingHttpServletRequest;
import com.adobe.aem.guides.wknd.spa.angular.core.models.CustomComponent;
@Model(adaptables = SlingHttpServletRequest.class, adapters = { CustomComponent.class,
ComponentExporter.class }, resourceType = CustomComponentImpl.RESOURCE_TYPE, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
@Exporter(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, extensions = ExporterConstants.SLING_MODEL_EXTENSION)
public class CustomComponentImpl implements CustomComponent {
static final String RESOURCE_TYPE = "wknd-spa-angular/components/custom-component";
@ValueMapValue
private String message;
@Override
public String getMessage() {
return StringUtils.isNotBlank(message) ? message.toUpperCase() : "";
}
@Override
public String getExportedType() {
return CustomComponentImpl.RESOURCE_TYPE;
}
}
and below is my customComponent.ts file:
import { Component, Input, OnInit } from '@angular/core';
import {MapTo} from '@adobe/cq-angular-editable-components';
const CustomEditConfig = {
emptyLabel: 'Custom Component',
isEmpty: cqModel =>
!cqModel || !cqModel.message || cqModel.message.trim().length < 1
};
@Component({
selector: 'app-custom',
templateUrl: './custom.component.html',
styleUrls: ['./custom.component.css']
})
export class CustomComponent implements OnInit {
@Input() message: string;
constructor() { }
ngOnInit(): void {
}
}
MapTo('wknd-spa-angular/components/custom-component')(CustomComponent, CustomEditConfig);
Can you show the detailled error message? I would assume that you are using the "model" selector at the wrong location/resource type.
Views
Replies
Sign in to like this content
Total Likes
Hi
1780 TIMER_END{31,ServletResolution} URI=/content/wknd-spa-angular/us/en/home/jcr:content/root/responsivegrid/custom_component.model.json handled by Servlet=org.apache.sling.servlets.get.DefaultGetServlet
2443 LOG Using org.apache.sling.servlets.get.impl.helpers.JsonRenderer to render for extension=json
for me that's the problem, because it should not resolve to the DefaultGetServlet, but to a servlet of the SlingModels package.
At which step in the tutorial does this problem occurr?
Views
Replies
Sign in to like this content
Total Likes
Views
Replies
Sign in to like this content
Total Likes
Views
Replies
Sign in to like this content
Total Likes
I face the issue too, I update components POST request success then call GET request get component update content, but get the err.
Views
Replies
Sign in to like this content
Total Likes