Quantcast
Viewing all articles
Browse latest Browse all 229906

How to use this in ionic?

If you're ok with the fact you do not know what's going on. Here is one possible solution. It should work.


  <body ng-app="app" ng-controller="ctrl">
    <ion-pane>
      <ion-header-bar class="bar-stable">
        <h1 class="title">Awesome App</h1>
      </ion-header-bar>
      <ion-content class="padding has-header">
        <label class="item item-input">
<span class="input-label">Number</span>
<input id="shifttime" type="text" placeholder="" ng-model="number">
</label>
<button ng-click="postData(number)" class="button">Send data</button>
      </ion-content>
    </ion-pane>
  <script>
angular.module('app', ['ionic']).controller('ctrl', function($scope, $http){

  $scope.postData = function (number) {
    console.log(number + " posted");
  $http({
    method: 'POST',
    url: 'https://api.parse.com/1/classes/shifts',
    data: {
          input: number
    },
    headers: {
        'X-Parse-Application-Id': '',
        'X-Parse-REST-API-Key': '',
    }
})
.success(function (data, status) {

})
.error(function (data, status) {

});
};
});</script>
</body>


Viewing all articles
Browse latest Browse all 229906

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>