Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ion-view title="Signup" id="page8">
- <ion-content padding="true" class="has-header">
- <form id="signup-form2" ng-controller="signupCtrl" method="post" class="list">
- <label class="item item-input" id="signup-input5">
- <span class="input-label">Password:</span>
- <input type="password" required="required" ng-model="passwordField" placeholder="">
- </label>
- <label class="item item-input" id="signup-input7">
- <span class="input-label">Confirm Password:</span>
- <input type="password" required="required" ng-model="confirmPasswordField" placeholder="">
- </label>
- </ion-list>
- <div ng-controller="signupCtrl">
- {{textveld}}
- </div>
- <button id="signup-button3" class="button button-stable button-block" ng-click="details()" ng-model="submitButton" ng-controller="signupCtrl" >Sign up</button>
- </form>
- </ion-content>
- </ion-view>
- .controller('signupCtrl', ['$scope', '$http', '$stateParams', '$timeout', // The following is the constructor function for this page's controller. See https://docs.angularjs.org/guide/controller
- // You can include any angular dependencies as parameters for this function
- // TIP: Access Route Parameters for your page via $stateParams.parameterName
- function ($scope, $http, $stateParams, $timeout) {
- // Signup page functions
- $scope.textveld = 'Hallo!';
- $scope.details = function(){
- if($scope.passwordField === $scope.confirmPasswordField) {
- $http.post('[MY URL]',{
- username: $scope.usernameField,
- email: $scope.emailField,
- password: $scope.passwordField
- }
- )
- .then(function(response) {
- $scope.contents = response.data;
- console.log($scope.contents);
- //THIS DOESN'T WORK
- $scope.textveld = response.data;
- //$scope.$apply();
- });
- }
- else {
- $scope.textveld = "Passwords do not match";
- }
- };
- }])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement