Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module('your_app_name.auth.controllers', [])
- .controller('WelcomeCtrl', function($scope, $state, $ionicModal){
- // $scope.bgs = ["http://lorempixel.com/640/1136"];
- $scope.bgs = ["img/welcome-bg.jpeg"];
- $scope.facebookSignIn = function(){
- console.log("doing facebbok sign in");
- $state.go('app.feed');
- };
- $ionicModal.fromTemplateUrl('views/app/legal/privacy-policy.html', {
- scope: $scope,
- animation: 'slide-in-up'
- }).then(function(modal) {
- $scope.privacy_policy_modal = modal;
- });
- $ionicModal.fromTemplateUrl('views/app/legal/terms-of-service.html', {
- scope: $scope,
- animation: 'slide-in-up'
- }).then(function(modal) {
- $scope.terms_of_service_modal = modal;
- });
- $scope.showPrivacyPolicy = function() {
- $scope.privacy_policy_modal.show();
- };
- $scope.showTerms = function() {
- $scope.terms_of_service_modal.show();
- };
- })
- .controller('CreateAccountCtrl', function($scope, $state, $http){
- $scope.user ={
- email:'',
- phone:'',
- password:'',
- username:'',
- name:''
- }
- $scope.doSignUp = function(){
- console.log("doing sign up");
- var headers = new Headers();
- headers.append('x-parse-application-id', 'AppId1');
- headers.append('x-parse-rest-api-key', 'restAPIKey');
- headers.append('Content-Type','application/json')
- var dataObject = {
- "first_name": $scope.name,
- "username": $scope.last_name,
- "passsword": $scope.passsword,
- "email": $scope.email
- };
- var dataObjectString = JSON.stringify(dataObject);
- var baseURL ="https://outing-zionnite.c9users.io/app1/classes/user";
- $http.post(baseURL, dataObjectString, {headers: headers})
- .then(function (response) {
- console.log('adding to parse', response);
- return response.data;
- });
- //$state.go('app.feed');
- //$state.go('app.feed');
- };
- })
- .controller('WelcomeBackCtrl', function($scope, $state, $ionicModal){
- $scope.doLogIn = function(){
- console.log("doing log in");
- $state.go('app.feed');
- };
- $ionicModal.fromTemplateUrl('views/auth/forgot-password.html', {
- scope: $scope,
- animation: 'slide-in-up'
- }).then(function(modal) {
- $scope.forgot_password_modal = modal;
- });
- $scope.showForgotPassword = function() {
- $scope.forgot_password_modal.show();
- };
- $scope.requestNewPassword = function() {
- console.log("requesting new password");
- };
- // //Cleanup the modal when we're done with it!
- // $scope.$on('$destroy', function() {
- // $scope.modal.remove();
- // });
- // // Execute action on hide modal
- // $scope.$on('modal.hidden', function() {
- // // Execute action
- // });
- // // Execute action on remove modal
- // $scope.$on('modal.removed', function() {
- // // Execute action
- // });
- })
- .controller('ForgotPasswordCtrl', function($scope){
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement