Skip to content

Instantly share code, notes, and snippets.

@hto
Last active January 18, 2018 12:37
Show Gist options
  • Save hto/bb8ae966850eef1fab5cf483217a7b0f to your computer and use it in GitHub Desktop.
Save hto/bb8ae966850eef1fab5cf483217a7b0f to your computer and use it in GitHub Desktop.
Angular Ng-model Simple
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
Name: <input ng-model="title"> <br />
Content: <input ng-model="content">
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', ['$scope', '$http', function($scope, $http) {
// Örnek bir kod post methodu
$http.post('', JSON.stringify({'name': $scope.name, 'content': $scope.content})).then(function (response) {}});
}]);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment