| 123456789101112131415161718192021222324 |
- /**
- * A pane that displays/edits unit objects
- */
- (function() {
- (function() {
- try {return angular.module('ieat.ui.editors')}
- catch {return angular.module('ieat.ui.editors', ['ndbDatabase', 'Units'])}}
- )().component('unitEditor', {
- templateUrl: 'static/templates/unitEditor.html',
- bindings: {
- unit: '<'
- },
- controller: ['$scope', function($scope) {
- var self = this;
- $scope.unitTypes = ["Mass", "Volume", "Count"];
- $scope.addAlias = function(alias) {
- self.unit.aliases.push(alias);
- };
- $scope.deleteAlias = function(index) {
- self.unit.aliases.splice(index, 1);
- };
- }]
- });
- })();
|