Last active
January 18, 2018 12:37
-
-
Save hto/bb8ae966850eef1fab5cf483217a7b0f to your computer and use it in GitHub Desktop.
Angular Ng-model Simple
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
<!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