Components: Add radio button provider to documentation

Created on 8 Jul 2016  路  6Comments  路  Source: angular/components

https://github.com/angular/material2/tree/master/src/components/radio

README doesn't mention that you need MdUniqueSelection Dispatcher.

docs help wanted

Most helpful comment

How is this working with the new module system?
Shouldn't the MdRadioModule be self contained enough that you can add it to your imports and everything should work?

All 6 comments

I would like to fix this to get familiar with the contribution process but have not found the similar examples in the docs or guide on where to put such dependency information.
My best guess is in the "Notes":

  • Requires MdUniqueSelectionDispatcher as a provider from @angular2-material/core.
    What do you think?

@pgurenko Thanks for taking this on! I think the best place would actually be on top, before the examples (to make sure it's seen). Add a section for "Setup" and show how you'd import the symbols, add the provider to providers, and add the directives to directives.

Something like that?

Setup

Importing the symbols:

import { MdUniqueSelectionDispatcher } from '@angular2-material/core';
import { MD_RADIO_DIRECTIVES } from '@angular2-material/radio';

Adding providers and directives:

@Component({
  directives: [MD_RADIO_DIRECTIVES],
  providers: [MdUniqueSelectionDispatcher]
})

Yeah, that looks great. Only nitpick would be to add ellipses so it's clear the selector, template, etc are missing.

@Component({
  ...
  directives: [MD_RADIO_DIRECTIVES],
  providers: [MdUniqueSelectionDispatcher]
})

How is this working with the new module system?
Shouldn't the MdRadioModule be self contained enough that you can add it to your imports and everything should work?

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings