Skip to content

Instantly share code, notes, and snippets.

@thanhlmm
Created June 3, 2016 17:22
Show Gist options
  • Save thanhlmm/2211ae7b1ada8af2953ccc5a257e2040 to your computer and use it in GitHub Desktop.
Save thanhlmm/2211ae7b1ada8af2953ccc5a257e2040 to your computer and use it in GitHub Desktop.
TestApp
<div class="myApp" ng-controller="myAppCtrl">
<form ng-submit="sendData">
<h3>Ten Cua ban</h3>
<input type="text" ng-model="fields.name">
</form>
</div>
<style>
.myApp {
background-color: green;
}
</style>
<script>
angular.module('lacaApp').controller('myAppCtrol', ['$scope', '$restful'], function ($scope, $restful) {
$scope.sendData = function () {
$restful.post('/app/8/play', {fields: $scope.fields.name}, function (error, result) {
console.log (error);
console.log (result);
});
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment