Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div>
- <input type="text"
- class="form-control defaultPassword"
- ng-model="username"
- placeholder="username">
- </div>
- <div class="form-group">
- <input type="password"
- ng-model="password"
- class="form-control {% verbatim %}{{ passwordBox }}{% endverbatim %}"
- placeholder="password">
- </div>
- <div>
- <span>{% verbatim %}{{ message }}{% endverbatim %}</span>
- <button id="submitBtn" class="btn" ng-click="login()">login</button>
- </div>
- todoApp.controller("LoginController",
- function LoginController($scope, $http){
- $scope.username = "";
- $scope.password = "";
- $scope.login = Login;
- function Login(){
- $http({
- method: 'POST',
- url: '/api/login',
- data: {
- username: $scope.username,
- password: $scope.password
- },
- headers: {'Content-Type': 'application/x-www-form-urlencoded'}
- }).then(function successCallback(response) {
- console.log(response);
- }, function errorCallback(response) {
- alert("error");
- });;
- }
- /**
- * @Route("/api/login")
- * @Method("POST")
- */
- public function apiLogin(Request $request){
- $us = $request->request->get("username");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement