Removing shapes in Angular

Hello Everyone, I’m having some trouble at removing shapes from my diagram.
When i’m using the function bellow It removes the shape from display but doesn’t remove from XML code when I use this.modeler.saveXML(…);.
What Am I doing wrong? Tell me if you need more details, tks.

deleteMe(variable: any) {
    this.modeler.get('canvas').removeShape(variable);
    this.modeler.saveXML((err, xmlNew) => {
      console.log(xmlNew);
    });
  }

Hi @patrikfr, welcome!

Canvas#removeShape only removes the shape from the canvas, but not completely from your diagram. Modeling#removeShape is what you’re looking for.