Topic: Adding tags doesn’t work

junior5417 pro asked 5 years ago


<form>
<div class="md-form">
<mdb-material-chips id="productHashTag" [(ngModel)]="addtags"></mdb-material-chips>
<div class="text-muted">
Type a name and press enter to add tag. Click X to remove it.
</div>
</div>
</form>

If its wrapped inside the forms then it willl not work.


Damian Gemza staff commented 5 years ago

Dear junior5417, Could you please specify, what exactly doesn't work in your app? I've tried to reproduce your case - copied your code, and for me, everything is working fine. When I type something in the input and type enter, the tag is added. Please check if you're importing FormsModule in AppModule file. It's necessary to import FormsModule. Best Regards, Damian

junior5417 pro commented 5 years ago

hmm, doesn't work when i type enter and the tag is not added. I've already added FormsModule in AppModule.

junior5417 pro commented 5 years ago

btw, im using version 6.0.2.

Damian Gemza staff commented 5 years ago

Dear junior5417, Could you please show me your app.module (or another module where you're using our MDB modules)? Between 6.0.2 and 6.2.1 there were a few breaking changes, so please check our Changelog for new modules name. Changelog: https://mdbootstrap.com/angular/changelog/#602 Best Regards, Damian

junior5417 pro commented 5 years ago

I found out what the issue is. If the code are wrapped inside then i'll not work as expected. Anyway to make it work inside a form?

Arkadiusz Idzikowski staff commented 5 years ago

Dear junior5417, Could you provide example code and reproduction steps? That would help us to debug the problem. Best, Arek

junior5417 pro commented 5 years ago

Please check the snippet on top, I've replaced the content

Arkadiusz Idzikowski staff commented 5 years ago

Try to add 'name' attribute to the mdb-material-chips element and it should work fine. It is required when ngModel is used inside a form.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Opened

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags