Components: feat: @angular2-material/all

Created on 28 Mar 2016  路  7Comments  路  Source: angular/components

it would be great if we had @angular2-material/all that also exported MATERIAL_DIRECTIVES and MATERIAL_PROVIDERS. At the moment, you need to require everything manually

import {MD_SIDENAV_DIRECTIVES} from '@angular2-material/sidenav';
import {MdToolbar} from '@angular2-material/toolbar';
import {MdButton} from '@angular2-material/button';
import {MdCheckbox} from '@angular2-material/checkbox';
import {MdRadioButton} from '@angular2-material/radio';
import {MdSpinner} from '@angular2-material/progress-circle';
import {MD_CARD_DIRECTIVES} from '@angular2-material/card';
const MATERIAL_DIRECTIVES = [
  ...MD_SIDENAV_DIRECTIVES,
  ...[ MdToolbar, MdButton, MdCheckbox, MdRadioButton, MdSpinner ],
  ...MD_CARD_DIRECTIVES
];
  "dependencies": {
    "@angular2-material/button": "^2.0.0-alpha.1",
    "@angular2-material/card": "^2.0.0-alpha.1",
    "@angular2-material/checkbox": "^2.0.0-alpha.1",
    "@angular2-material/core": "^2.0.0-alpha.1",
    "@angular2-material/progress-circle": "^2.0.0-alpha.1",
    "@angular2-material/radio": "^2.0.0-alpha.1",
    "@angular2-material/sidenav": "^2.0.0-alpha.1",
    "@angular2-material/toolbar": "^2.0.0-alpha.1",
    "angular2": "2.0.0-beta.12",
    "core-js": "^2.1.5",
    "rxjs": "5.0.0-beta.2",
    "zone.js": "0.6.6"
  },
P3 feature

Most helpful comment

I believe both options should be supported, i.e

import all MATERIAL_DIRECTIVES and MATERIAL_PROVIDER
Good for the projects utilizing all/most of the directive/providers

import specific MATERIAL_DIRECTIVES and MATERIAL_PROVIDER
Good for projects utilizing only specific directives

May be more options could be given by grouping related directives:

@angular2-material/all
import all directives

@angular2-material/form-directives
import form related directives such as input, checkboxes, radio, slide toggle, select etc.

@angular2-material/ui
import ui related directives related directives such as side nav, menu, list, dialog, tabs etc.

All 7 comments

I believe both options should be supported, i.e

import all MATERIAL_DIRECTIVES and MATERIAL_PROVIDER
Good for the projects utilizing all/most of the directive/providers

import specific MATERIAL_DIRECTIVES and MATERIAL_PROVIDER
Good for projects utilizing only specific directives

May be more options could be given by grouping related directives:

@angular2-material/all
import all directives

@angular2-material/form-directives
import form related directives such as input, checkboxes, radio, slide toggle, select etc.

@angular2-material/ui
import ui related directives related directives such as side nav, menu, list, dialog, tabs etc.

@jelbourn this issue seems ready to be closed as #950 exports all module.

Can you please release the @angular2-material/all to npm repo? The code is there but it's not available in npm.

@itrethan you can copy this code and adapt it to your needs. This has the benefit that you can include in this file only modules which you use in your app instead of including all modules.

@jelbourn I think this can be closed now?

Yep.

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

Related issues

LoganDupont picture LoganDupont  路  3Comments

MurhafSousli picture MurhafSousli  路  3Comments

julianobrasil picture julianobrasil  路  3Comments

constantinlucian picture constantinlucian  路  3Comments

Miiekeee picture Miiekeee  路  3Comments