/** * Wrapper for the new ngReact directive for backward compatibility. * Allows remaining untouched in outdated plugins. * Technically, it's just a wrapper for react component with two-way data binding support. */ import coreModule from '../core_module'; /** @ngInject */ export function spectrumPicker() { return { restrict: 'E', require: 'ngModel', scope: true, replace: true, template: '', link: (scope: any, element: any, attrs: any, ngModel: any) => { scope.ngModel = ngModel; scope.onColorChange = (color: string) => { ngModel.$setViewValue(color); }; }, }; } coreModule.directive('spectrumPicker', spectrumPicker);