Created
June 3, 2016 17:22
-
-
Save thanhlmm/2211ae7b1ada8af2953ccc5a257e2040 to your computer and use it in GitHub Desktop.
TestApp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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