Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. <ion-view title="Signup" id="page8">
  2. <ion-content padding="true" class="has-header">
  3. <form id="signup-form2" ng-controller="signupCtrl" method="post" class="list">
  4. <label class="item item-input" id="signup-input5">
  5. <span class="input-label">Password:</span>
  6. <input type="password" required="required" ng-model="passwordField" placeholder="">
  7. </label>
  8. <label class="item item-input" id="signup-input7">
  9. <span class="input-label">Confirm Password:</span>
  10. <input type="password" required="required" ng-model="confirmPasswordField" placeholder="">
  11. </label>
  12. </ion-list>
  13. <div ng-controller="signupCtrl">
  14. {{textveld}}
  15. </div>
  16. <button id="signup-button3" class="button button-stable button-block" ng-click="details()" ng-model="submitButton" ng-controller="signupCtrl" >Sign up</button>
  17. </form>
  18. </ion-content>
  19. </ion-view>
  20.  
  21. .controller('signupCtrl', ['$scope', '$http', '$stateParams', '$timeout', // The following is the constructor function for this page's controller. See https://docs.angularjs.org/guide/controller
  22. // You can include any angular dependencies as parameters for this function
  23. // TIP: Access Route Parameters for your page via $stateParams.parameterName
  24. function ($scope, $http, $stateParams, $timeout) {
  25. // Signup page functions
  26.  
  27. $scope.textveld = 'Hallo!';
  28.  
  29. $scope.details = function(){
  30. if($scope.passwordField === $scope.confirmPasswordField) {
  31. $http.post('[MY URL]',{
  32. username: $scope.usernameField,
  33. email: $scope.emailField,
  34. password: $scope.passwordField
  35. }
  36. )
  37. .then(function(response) {
  38. $scope.contents = response.data;
  39. console.log($scope.contents);
  40. //THIS DOESN'T WORK
  41. $scope.textveld = response.data;
  42. //$scope.$apply();
  43. });
  44. }
  45. else {
  46. $scope.textveld = "Passwords do not match";
  47.  
  48. }
  49.  
  50. };
  51. }])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement