2

I recentrly started using the material.angular.io components on my app: https://material.angular.io/components/component/button-toggle

Im seeing in the doc that the button-toggle component has an @Input property called selected that is not setting as selected my button like the disabled property is setting as disabled the other one... I'm doing something wrong?

Here is a plunkr: https://plnkr.co/edit/tGZVAbJZpYDxxmKyPRKg?p=preview

Nehal
  • 13,130
  • 4
  • 43
  • 59
PriNcee
  • 2,436
  • 3
  • 17
  • 21

1 Answers1

2

In the documentation selected is listed for MdButtonToggleGroup. For MdButtonToggle, the property you need to use is checked.

I have forked your Plunker and edited to show the tab 'One' is selected/checked, Demo.

Let me know if this fixes your issue :)

Nehal
  • 13,130
  • 4
  • 43
  • 59
  • thank you!! can u ask me another question? how can I check the first option found in a loop? https://plnkr.co/edit/tGZVAbJZpYDxxmKyPRKg?p=preview – PriNcee May 31 '17 at 14:46
  • Glad it helped! Please open a separate question for checking the first option in a loop. Then, it will be easier for other to locate this question. In the mean time, I'll try to find a solution :) – Nehal May 31 '17 at 14:57
  • https://stackoverflow.com/questions/44288434/angular-2-ngfor-first-last-index-loop – PriNcee May 31 '17 at 15:10