user7784271
user7784271

Reputation:

Split ng-model values(javascript+angularjs)

I am getting input text box values in my angular ng-model as 903290,902020. I want to insert this in mysql using nodejs with sequelize , so for bulk create i need array. How to convert this above 903290,902020 into array [903290,902020]

Upvotes: 0

Views: 359

Answers (1)

Red
Red

Reputation: 7299

You can use the JavaScript split function for this.

var string = "903290,902020";
var split = string.split(",");

console.log(split)

Upvotes: 2

Related Questions