ui5-webcomponents icon indicating copy to clipboard operation
ui5-webcomponents copied to clipboard

Angular Reactive Forms Support

Open urielrodriguezusma opened this issue 7 years ago • 2 comments

HI

  1. I'm trying to use Reactive Forms in angular with ui5-input control this way <ui5-input formControlName="userName"></ui5-input>

But I receive an exception errorUI

However, if I use a normal input with html works perfectly. Is it possible that I need to import some extra module?

  1. How can I use the two way data binding? I Install the package and imported OrigamiFormsModule but it doesn't work. Maybe I'm making a mistake.

  2. Finally How Can I apply the style sap-ui-compactSize in angular's project.

Thanks for your help.

urielrodriguezusma avatar Jul 26 '19 15:07 urielrodriguezusma

Hello @urielrodriguezusma

We are currently working on improving the two way databinding of the components. Follow: https://github.com/SAP/ui5-webcomponents/issues/651

Currently you can add a ngDefaultControl attribute to the ui5-input and it will enable you to use it for two way databinding. Please give a try to that solution for your points 1 and 2

  1. You can change the compact setting using the configuration script placed in your index.html
<script data-id='sap-ui-config' type="application/json">
	{
		"compactSize": true
	}
</script>

IMPORTANT: The configuration script attribute will be changed in the next release

~~data-id='sap-ui-config'~~ => data-ui5-config

<script data-ui5-config type="application/json">
	{
		"compactSize": true
	}
</script>

Please check the proposed solution and if they work we can duplicate this and follow https://github.com/SAP/ui5-webcomponents/issues/651

MapTo0 avatar Aug 07 '19 13:08 MapTo0

Hi @urielrodriguezusma,

About Reactive forms support: #706 is in master now and will be available in the next release.

I am closing the issue as all your questions have been answered. In future when you have a couple of problems, please open separate issues for each problem that you have 😊

Best regards, Filip

fifoosid avatar Aug 21 '19 12:08 fifoosid