Topic: MDB Select Angular 2 Issue

mog5808 pro asked 5 years ago


Hi guys, I am using mdbootstrap with angular 2. I was able to angularize quite some stuff based on need. Very hacky but it works so far. I do have trouble with the mdb-select though. I am not able to capture the value of the select Following is my html

<div class="col-xs-12 col-sm-6 col-md-4">

          <select class="mdb-select" formControlName="role">
            <option value="'travel_agent_r'">Auditor</option>
            <option value="'travel_agent_support'">Customer Support</option>
            <option value="'travel_agent_r_w'">Data Entry</option>
            <option value="'travel_agent'">Full Access</option>
            <option value="'travel_agent_sales'">Sales</option>
          </select>
          <label>Role *</label>
        </div>
And this is my typescript
    this.myForm = new FormGroup({
      role: new FormControl('', [<any> Validators.required, CustomValidators.notEqual('')]),
    });
any ideas?

Piotr Bender free answered 5 years ago


Hello,In response to your issue, I wanted to let you know about just released MDBootstrap Angular kit, that may be a sufficient solution to this or any other issues you have had with Angular integration so far.The kit can be found at the following link:https://mdbootstrap.com/angular/It contains all the components you could find in MDB jQuery version.We encourage you to try it out and report any bugs or issues at contact@mdbootstrap.com with [Angular] prefix or create a thread on this forum.Have a great day!


Rafał Rogulski free answered 5 years ago


Sorry, but we don't support Angular 2 now. You must do it on your own.

mog5808 pro answered 5 years ago


Okay i had to give up on using .mdb-select although i liked it alot. If someone finds a solution let me know. Here is how i get the value now,
 const newFormValues = this.myForm.valueChanges;
    newFormValues.subscribe((data) => {
      console.log(data.role);

    });


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Specification of the issue

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