Angularjs rest call example -
Angularjs rest call example -
!doctype html> <html ng-app="formmodule"> <body> <form method="get" ng-submit="submit()"> <div ng-controller="submitcontroller"> username :<input type="text" ng-model="uname"></br> password :<input type="password" ng-model="pwd"></br> <button ng-click="submit()">submit</button> </div> </form> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script> <script> var app=angular.module("formmodule",[]); app.controller("submitcontroller",function ($scope,$http) { $scope.submit = function () { var url = 'htttp://9.oo4.000.224:2020/restdemo/rest/user/'+$scope.uname+'/'+$scope.pwd; console.debug(url); $http.get(url).success(function (data) { $scope.output = data; console.debug(data); console.debug(output); });
my url correct.now uncertainty how response server.can 1 help me.when click submit button rerquest gose url , validate username , password.if username , password valide display details.otherwirse display login failed information.
angularjs angularjs-directive
Comments
Post a Comment