UNPKG

unserver-unify

Version:

29 lines 808 B
angular.module('bamboo').component('footerSignUp', { templateUrl: 'app/directive/form/footersignup.component.html', bindings: {}, controller: function($localStorage, $timeout, $state) { var self = this; self.$onInit = function() { self.formData = { fullname: '', email: '', broadcastEmail: true }; }; self.submit = function(form) { console.log(form); console.log(self.formData); self.submitted = true; if (form.$invalid) { self.shaking = true; $timeout(function() { self.shaking = false; }, 500); return; } $localStorage.FOOTER_SIGNUP_DATA = self.formData; self.formData = undefined; $state.go('index.setting.signup'); } } });