I wrote this code (below) to use the Editor widget of Arcgis API for JavaScript, knowing that before this code I defined my featurelayers (links to shapfiles uploaded on Arcgis server online Arcgis for developers (layers)) by this code I wanted to access all my layers(to edit, add and delete), finally the Editor widget works fine only for a day (I can update my data, delete,add yesterday), but now when I run it, it doesn't work and when I use Insepct element (development tools of google chrome), I find this error in the console:
Uncaught (in promise) TypeError: view.map.loadAll is not a function at index.html: 410
How to do to get rid of this error message?
view.when(() => {
view.map.loadAll().then(() => {
view.map.allLayers.forEach((layer) => {
if (layer.type === "feature") {
switch (layer.geometryType) {
case "polygon":
polygonLayer = layer;
break;
case "polyline":
lineLayer = layer;
break;
case "point":
pointLayer = layer;
break;
}
}
})
})
});