From 30bffc6525bc07b145405311f83a90e2d7e24b7f Mon Sep 17 00:00:00 2001 From: Ravindra Adireddy Date: Thu, 27 Dec 2018 17:38:40 +0530 Subject: [PATCH] fix(oui-select): nested property support for match api support nested property like "region.name" on match input in oui-select component Closes #MANAGER-2056 --- packages/oui-select/src/select.controller.js | 5 +++++ packages/oui-select/src/templates/match.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/oui-select/src/select.controller.js b/packages/oui-select/src/select.controller.js index 76fcc69a..fbe33041 100644 --- a/packages/oui-select/src/select.controller.js +++ b/packages/oui-select/src/select.controller.js @@ -1,4 +1,5 @@ import { addBooleanParameter } from "@ovh-ui/common/component-utils"; +import get from "lodash/get"; export default class { constructor ($attrs, $compile, $element, $scope, $timeout) { @@ -59,4 +60,8 @@ export default class { this.onFocus(); } + + getPropertyValue (item) { + return get(item, this.match, null); + } } diff --git a/packages/oui-select/src/templates/match.html b/packages/oui-select/src/templates/match.html index 4cff7035..f0e561af 100644 --- a/packages/oui-select/src/templates/match.html +++ b/packages/oui-select/src/templates/match.html @@ -15,7 +15,7 @@ + ng-bind-html="$ctrl.getPropertyValue($select.selected) || $select.selected">