1
0
mirror of https://github.com/Foltik/Shimapan synced 2025-04-01 08:11:37 -04:00

Fix component definitions to work with minifying

This commit is contained in:
Jack 2017-10-14 15:37:06 -04:00
parent 582b1260a2
commit 2f5156c198
Signed by: foltik
GPG Key ID: 303F88F996E95541
3 changed files with 70 additions and 76 deletions

View File

@ -1,15 +1,13 @@
function LoginController($scope, AuthService) { angular.module('LoginComp', ['AuthSvc']).component('loginComponent', {
$scope.login = function() { templateUrl: '/views/shimapan/login-form.html',
controller: ['$scope', 'AuthService', function ($scope, AuthService) {
$scope.login = function () {
AuthService.login({ AuthService.login({
username: $scope.username, username: $scope.username,
password: $scope.password password: $scope.password
}).then(function() { }).then(function () {
alert('Logged In'); alert('Logged In');
}); });
} }
} }]
angular.module('LoginComp', ['AuthSvc']).component('loginComponent', {
templateUrl: '/views/shimapan/login-form.html',
controller: LoginController
}); });

View File

@ -1,16 +1,14 @@
function RegisterController($scope, AuthService) { angular.module('RegisterComp', ['AuthSvc']).component('registerComponent', {
$scope.register = function() { templateUrl: '/views/shimapan/register-form.html',
controller: ['$scope', 'AuthService', function ($scope, AuthService) {
$scope.register = function () {
AuthService.register({ AuthService.register({
username: $scope.username, username: $scope.username,
password: $scope.password, password: $scope.password,
invite: $scope.invite invite: $scope.invite
}).then(function() { }).then(function () {
alert('Registered'); alert('Registered');
}); });
}; };
} }]
angular.module('RegisterComp', ['AuthSvc']).component('registerComponent', {
templateUrl: '/views/shimapan/register-form.html',
controller: RegisterController
}); });

View File

@ -1,12 +1,14 @@
function UploadController($scope, Upload, $timeout, AuthService) { angular.module('UploadComp', ['ngFileUpload', 'AuthSvc']).component('uploadComponent', {
$scope.errToString = function(err) { templateUrl: '/views/shimapan/upload-form.html',
controller: ['$scope', 'Upload', '$timeout', 'AuthService', function ($scope, Upload, $timeout, AuthService) {
$scope.errToString = function (err) {
if (err === 'maxSize') if (err === 'maxSize')
return "File too large."; return "File too large.";
else else
return err; return err;
}; };
$scope.uploadFiles = function(files, errorFiles) { $scope.uploadFiles = function (files, errorFiles) {
$scope.files = $scope.files ? $scope.files.concat(files) : files; $scope.files = $scope.files ? $scope.files.concat(files) : files;
$scope.errorFiles = $scope.errorFiles ? $scope.errorFiles.concat(errorFiles) : errorFiles; $scope.errorFiles = $scope.errorFiles ? $scope.errorFiles.concat(errorFiles) : errorFiles;
@ -46,10 +48,6 @@ function UploadController($scope, Upload, $timeout, AuthService) {
); );
}); });
}; };
} }],
angular.module('UploadComp', ['ngFileUpload', 'AuthSvc']).component('uploadComponent', {
templateUrl: '/views/shimapan/upload-form.html',
controller: UploadController,
controllerAs: 'vm' controllerAs: 'vm'
}); });