How to fetch Page Properties in JS in AEM 6.2
Hi,
i have a requirement in which i have to disable a dialog property on the basis of a property in jcr:content node. To implement this i have written a custom js. Problem is i'm not able to get page property value in JS . i'm using below code (it seems it doesn't work for Touch UI)
$(document).on("dialog-ready", function () {
var pageData = CQ.HTTP.get(CQ.HTTP.externalize(CQ.utils.WCM.getPagePath() + "/jcr:content.json"));
var producMaster = pageData ? CQ.Util.formatData(CQ.HTTP.eval(pageData))['cq:productMaster'] : null;
alert(producMaster);
}
I have also tried this one also
$(document).on("dialog-ready", function () {
granite.resource.properties["cq:productMaster];
}
but it shows message granite can't be resolved
Can anyone help here how i can read page properties.