I'm encountering a strange issue with my Cordova Android project (AngularJS + Ionic). When I run the project in Android Studio, I receive an error on my JS file that says:
Uncaught SyntaxError: Unexpected token {, http://192.168.43.211:8100/templates/todo/js/controllers.js, Line: 184
However, when I run the same file in Google Chrome, it works fine without any errors.
Below is the code causing the error message:
$scope.todos = $scope.todos.map(({text, status, note, create_date, to_do_id}) => {
var ch;
if(status=='1') ch=true; else ch=false;
console.log(ch);
return {
text,
flag:ch,
note:note,
to_do_id:to_do_id,
create_date:create_date,
status:status
};
});
If I hide the above code block, no error is shown in the Android Studio console. However, I need this code block to complete the functionality.
Any insights on what the problem might be?