Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

How to use this in ionic?

$
0
0

@twobrothers wrote:

I want to be able to get text from a textbox and POST to parse...

Button
<button class="button button-dark button-block" id="shifttime">Add Now</button>

POST Method
`$('button').click(function(e) {
e.preventDefault();

var text = $('#shifttime');
$.ajax({
	url : 'https://api.parse.com/1/classes/shifts',
	type : 'POST',
	contentType : 'application/json',
	headers : {
		'X-Parse-Application-Id': '',
              'X-Parse-REST-API-Key': '',
              'Content-Type': 'application/json'
	},
	data : JSON.stringify({
				shifttime : text.val()
			}),
	error : function(data) {
		console.log('error');
	},
	success : function(data) {
		console.log('success', data)
		$('ul').append('<li>' + "Shift Added" + '</li>');
	}
});

However JQuery isn't working in Ionic... So how can i do this exact same thing with $HTTP Post?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



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