Skip to content

Instantly share code, notes, and snippets.

@brigand
Last active November 20, 2015 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brigand/d17bfee4ffcb6c8f04df to your computer and use it in GitHub Desktop.
Save brigand/d17bfee4ffcb6c8f04df to your computer and use it in GitHub Desktop.
show(status, slotId, carStatusTypeInfo) {
var typeIdForCar = '';
if (typeof status === 'undefined') {
var types = ['ACTIVE', 'DISABLED', /* ... */];
typeIdForCar = types.reduce(function(value, type){
return value || this.getTypeIdForCar(carStatusTypeInfo, type);
}, '');
} else {
typeIdForCar = this.getTypeIdForCar(carStatusTypeInfo, status)
}
this.$state.go('slotInfo', {
slotId: slotId,
versionId: typeIdForCar,
gid: this.$stateParams.gid
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment