Software Archive
Read-only legacy content
17061 Discussions

Ionic passing data with JSON


Hi I'm trying to pass data from my APK that is based on HTML using Intel XDK, as framework i use Ionic. I make a form with some text input and comboBox where i get the data that i want to send. I have some part of my code where i get data from a text input and combo box and at the end the JSON. The main problem that i have is how to make fit the data that i get into that JSON structure. 

    <form ng-submit="submitEvent(event)">
                                <label class="item item-input">
                                    <span class="input-label">Rut</span>
                                    <input type="text" ng-model="event.rut">
    <label class="item item-input item-select">
                                <div class="input-label">
                                <select ng-model="selectedComuna" ng-options="x for x in comuna track by x"></select>

            var app = angular.module('myApp', []);
            app.controller('myCtrl', function($scope) {
                $ = '';
                $scope.selectedName = '';
                $scope.region = ["Región de Los Ríos"];
                $scope.names = ["A+", "A-", "B+", "B-", "O+", "O-", "AB+", "AB-"];
                $scope.comuna = ["Corral", "Lanco", "Los Lagos", "Máfil", "Mariquina", "Paillaco", "Panguipulli", "Valdivia", "Futrono", "La Unión", "  Lago Ranco", "Río Bueno" ];
            angular.module('myApp', ['ionic']).controller('ctrl', function($scope, $http){

              $scope.postData = function () {
                console.log(" posted");
                type: 'POST',
                url: '',
                dataType: 'json',  
                data: {
                      input: event.rut 
                headers: {
                    'X-Parse-Application-Id': '',
                    'X-Parse-REST-API-Key': '',
            .success(function (data, status) {

            .error(function (data, status) {

0 Kudos
1 Reply

Nicolas -- how to write code in HTML5 and use the various HTML5 frameworks is outside the scope of this forum. I recommend you check the Iconic and Angular forums and StackOverflow for advice on how to do what you are asking.

0 Kudos