Add implementation for credential_type lookup

This commit is contained in:
gconsidine
2017-06-26 10:52:14 -04:00
parent 2fa4b3db5b
commit d63ab2811a
6 changed files with 33 additions and 40 deletions

View File

@@ -39,7 +39,7 @@ function atFormActionController ($state) {
scope.text = 'CANCEL';
scope.fill = 'Hollow';
scope.color = 'default';
scope.action = () => $state.go('^');
scope.action = () => $state.go(scope.to || '^');
};
vm.setSaveDefaults = () => {
@@ -64,7 +64,8 @@ function atFormAction (pathService) {
link,
scope: {
state: '=',
type: '@'
type: '@',
to: '@'
}
};
}

View File

@@ -19,16 +19,20 @@ function AtInputLookupController (baseInputController, $state, $stateParams) {
scope = _scope_;
scope.$watch(scope.state._resource, () => {
if (scope[scope.state._resource]) {
scope.state._value = scope[scope.state._resource];
scope.state._displayValue = scope[`${scope.state._resource}_name`];
}
});
scope.$watch(scope.state._resource, vm.watchResource);
vm.check();
};
vm.watchResource = () => {
if (scope[scope.state._resource]) {
scope.state._value = scope[scope.state._resource];
scope.state._displayValue = scope[`${scope.state._resource}_name`];
vm.check();
}
};
vm.search = () => {
let params = {};
@@ -36,7 +40,6 @@ function AtInputLookupController (baseInputController, $state, $stateParams) {
params.selected = scope.state._value;
}
console.log(scope.state);
$state.go(scope.state._route, params);
};
}