We can use input data to pass it as a parameter in the HTML file w use ng-model to bind the value of input field.
<input type="text" placeholder="Enter your Email" ng-model="email" required>
<input type="text" placeholder="Enter your password " ng-model="password" required>
and in the js file w use $scope to access this data:
$scope.email="";
$scope.password="";
Controller function will be something like that:
var app = angular.module('myApp', []);
app.controller('assignController', function($scope, $http) {
$scope.email="";
$scope.password="";
$http({
method: "POST",
url: "http://localhost:3000/users/sign_in",
params: {email: $scope.email, password: $scope.password}
}).then(function mySuccess(response) {
// a string, or an object, carrying the response from the server.
$scope.myRes = response.data;
$scope.statuscode = response.status;
}, function myError(response) {
$scope.myRes = response.statusText;
});
});