Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- angular.module('myApp.pendaftaran', [])
- .config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {
- $stateProvider
- .state('pendaftaran', {
- url: '/pendaftaran',
- data: {
- permissions: {
- except: ['isloggedin'],
- redirectTo: 'login'
- }
- },
- views: {
- 'Content': {
- templateUrl: "pendaftaran/pendaftaran.html",
- controller: 'PendaftaranCtrl as pendaftaran'
- }
- }
- })
- }])
- .controller('PendaftaranCtrl', ['$http', '$auth', '$rootScope','$state', '$q' , function($http, $auth, $rootScope, $state, $q) {
- var vm = this;
- vm.pendaftaran = [];
- vm.error;
- vm.no=function(){
- $state.go('login');
- }
- vm.addUser = function() {
- vm.username;
- vm.password;
- vm.confirm_password;
- vm.email;
- vm.nama;
- vm.telepon;
- vm.aktif = '1';
- vm.statbio = 'Belum Mengisi Biodata';
- $http.post('http://localhost:8000/api/v1/pendaftaran', {
- username: vm.username,
- password: vm.password,
- email: vm.email,
- telepon: vm.telepon,
- aktif: vm.aktif,
- statbio: vm.statbio
- }).success(function(response) {
- vm.password = '';
- vm.confirm_password = '';
- vm.email = '';
- vm.telepon = '';
- }).error(function(){
- console.log("error");
- });
- $http.post('http://localhost:8000/api/v1/calonmahasiswa', {
- nama: vm.nama,
- }).success(function(response) {
- vm.nama = '';
- $('#Popup').modal('show');
- }).error(function(){
- console.log("error");
- });
- };
- vm.daftar = function(){
- //Perintah protokol HTTP untuk mengirimkan data store pada endpoint pendaftaran
- $http.post('http://localhost:8000/api/v1/pendaftarpen', {
- username: vm.username,
- password: vm.password,
- nama: vm.nama,
- email: vm.email,
- telepon: vm.telepon,
- keterangan: '1',
- tahapan:'1',
- status:'1',
- }).success(function(response) {
- vm.password = '';
- vm.confirm_password = '';
- vm.nama = '';
- vm.email = '';
- vm.telepon = '';
- //Perintah protokol HTTP untuk mengirimkan data store pada endpoint pendaftar
- $http.post('http://localhost:8000/api/v1/pendaftar', {
- username: vm.username,
- }).success(function(response) {
- vm.username = '';
- alert('sukses');
- $state.go('login');
- }).error(function(){
- });
- }).error(function(){
- alert('gagal');
- });
- }
- }]);
Add Comment
Please, Sign In to add comment