Sha256: ebab725dd3bc46e11b5009aceff0f0ab0ff9f94224f9c8bd4cfc57bd7f46b41c
Contents?: true
Size: 1.34 KB
Versions: 217
Compression:
Stored size: 1.34 KB
Contents
/** * @ngdoc object * @name Bastion.host-collections.controller:HostCollectionFormController * * @requires $scope * @requires $q * @requires HostCollection * @requires CurrentOrganization * * @description * Provides the functionality specific to HostCollections for creating a new host collection */ angular.module('Bastion.host-collections').controller('HostCollectionFormController', ['$scope', '$q', 'HostCollection', 'CurrentOrganization', function ($scope, $q, HostCollection, CurrentOrganization) { function success(response) { $scope.table.addRow(response); $scope.transitionTo('host-collection.info', {hostCollectionId: $scope.hostCollection.id}); } function error(response) { $scope.working = false; angular.forEach(response.data.errors, function (errors, field) { $scope.hostCollectionForm[field].$setValidity('', false); $scope.hostCollectionForm[field].$error.messages = errors; }); } $scope.hostCollection = $scope.hostCollection || new HostCollection(); $scope.hostCollection['unlimited_hosts'] = true; $scope.save = function (hostCollection) { hostCollection['organization_id'] = CurrentOrganization; hostCollection.$save(success, error); }; }] );
Version data entries
217 entries across 217 versions & 1 rubygems