mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 15:15:34 +00:00
Encapsulate DB.js in angular constants to help testing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
angular.module('app').controller('OutfitController', ['$rootScope','$scope', '$state', '$stateParams', 'Ship', 'Components', 'Serializer', 'Persist', function ($rootScope, $scope, $state, $p, Ship, Components, Serializer, Persist) {
|
||||
var data = DB.ships[$p.shipId]; // Retrieve the basic ship properties, slots and defaults
|
||||
angular.module('app').controller('OutfitController', ['$rootScope','$scope', '$state', '$stateParams', 'ShipsDB', 'Ship', 'Components', 'Serializer', 'Persist', function ($rootScope, $scope, $state, $p, Ships, Ship, Components, Serializer, Persist) {
|
||||
var data = Ships[$p.shipId]; // Retrieve the basic ship properties, slots and defaults
|
||||
var ship = new Ship($p.shipId, data.properties, data.slots); // Create a new Ship instance
|
||||
|
||||
// Update the ship instance with the code (if provided) or the 'factory' defaults.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
angular.module('app').controller('ShipyardController', ['$rootScope', function ($rootScope) {
|
||||
angular.module('app').controller('ShipyardController', ['$rootScope', 'ShipsDB', function ($rootScope, ships) {
|
||||
$rootScope.title = 'Coriolis';
|
||||
$rootScope.bodyClass = 'docking-bay';
|
||||
$rootScope.ships = ships;
|
||||
}]);
|
||||
Reference in New Issue
Block a user