Angular - Insert, Update, Delete data

Hi all,

I encountered the following problem:

I followed the tutorial step-by-step and included my own api…my taskUrl-string looks like ‘http://localhost:3055/rm/api/task’ which I put in my task.service.ts.
The GET Request and the initial loading from my database-backend works fine…but my problem is every other Request type the POST, PUT, DELETE isn’t working.
I defined the same way as in the tutorial with gantt.createDataProcessor and so on, but according to my api-logging none of the above mentioned request types ever reached my test server.

My error message in the browser is the following:

ERROR TypeError: Cannot read property ‘substring’ of undefined
at t. (dhtmlxgantt.js:10)
at t.i (dhtmlxgantt.js:10)
at t.callEvent (dhtmlxgantt.js:10)
at t._sendData (dhtmlxgantt.js:10)
at t._beforeSendData (dhtmlxgantt.js:10)
at t.sendData (dhtmlxgantt.js:10)
at t.setUpdated (dhtmlxgantt.js:10)
at Object. (dhtmlxgantt.js:10)
at Object.i (dhtmlxgantt.js:10)
at Object.t.callEvent (dhtmlxgantt.js:10)
at String. (dhtmlxgantt.js:10)
at o.i (dhtmlxgantt.js:10)
at o.t.callEvent (dhtmlxgantt.js:10)
at o.addItem (dhtmlxgantt.js:10)
at Object.addTask (dhtmlxgantt.js:10)
at Object.t._save_lightbox (dhtmlxgantt.js:10)

I hope someone can help me to solve my problem.

Cheers,

Lukas

Ps: I posted this already over one week ago under the “dhtmlx-gantt-chart-usage-angularjs-2-framework” blog-post, but no response so far…that’s the reason why I look for help in the forum

Hello Lukas,

The tutorial uses the angular-in-memory-api library so the data is not actually saved on the backend.

Unfortunately, I don’t specialize in Angular, so I won’t be able to suggest to you what you need to add to make an Angular application work with the backend.

If you use the Data Process, you can try creating it in a different way:

var dp = new gantt.dataProcessor("http://localhost:3055/rm/api/task");
dp.init(gantt);
dp.setTransactionMode("REST");

Then you can open the web console and check the requests on the Network tab:


Ps: I posted this already over one week ago under the “dhtmlx-gantt-chart-usage-angularjs-2-framework” blog-post, but no response so far…that’s the reason why I look for help in the forum

Unfortunately, I cannot find your comment. Thank you for reporting that you posted the question. I will tell the dev team to check the blog settings.

1 Like