-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need documentation for Custom Module #3973
Comments
I know how to create an Angular module. What I don't know is what we are supposed to import from @angular/material, do you ? |
You are supposed to import whatever modules you are using in your app, ie. |
This is what I do:
And in my app.module.ts I import |
Are you sure you "know how to create an angular module" or that you actually read the guide I pointed you to? This section in particular https://angular.io/docs/ts/latest/guide/ngmodule.html#!#shared-module ? |
Why not point out my mistake? Imports instead of Exports... That doesn't change the fact that the documentation is missing. |
All working! All Good! |
Updated the getting started guide with an example. |
import { NgModule } from '@angular/core';
import {
MdButtonModule,
MdSnackBarModule,
MdCardModule,
MdInputModule,
MdCheckboxModule,
MdIconModule,
MdSidenavModule,
MdSelectModule,
MdToolbarModule,
MdListModule,
MdProgressBarModule,
MdProgressSpinnerModule } from '@angular/material';
import 'hammerjs';
@NgModule({
imports: [
MdButtonModule,
MdSnackBarModule,
MdCardModule,
MdInputModule,
MdCheckboxModule,
MdIconModule,
MdSidenavModule,
MdSelectModule,
MdToolbarModule,
MdListModule,
MdProgressBarModule,
MdProgressSpinnerModule ],
exports: [
MdButtonModule,
MdSnackBarModule,
MdCardModule,
MdInputModule,
MdCheckboxModule,
MdIconModule,
MdSidenavModule,
MdSelectModule,
MdToolbarModule,
MdListModule,
MdProgressBarModule,
MdProgressSpinnerModule ]
})
export class CustomMaterialModule { } My example :) |
AFAIK @candidosales the |
It is a bit annoying to repeat the list of modules in the ES5 import and the export annotation. Does it make any difference to import hammer here? Seems I'll need to import hammer in appmodule again, since I can't export it from here. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
According to the changelog of Beta 3 it is recommended to create our own Material module to reduce app size.
But I can't find any documentation on how to create my own Material module.
The text was updated successfully, but these errors were encountered: