How to use the @angular/material.MaterialModule.forRoot function in @angular/material

To help you get started, we’ve selected a few @angular/material examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AngularMN / prize-o-tron / src / app / rsvp.service.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports:[MaterialModule.forRoot()], // and this line
      providers: [RsvpService]
    });
  });
github Teradata / covalent-nightly / json-formatter / json-formatter.module.ts View on Github external
import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';

import { MaterialModule } from '@angular/material';

import { TdJsonFormatterComponent } from './json-formatter.component';

export { TdJsonFormatterComponent } from './json-formatter.component';

@NgModule({
  imports: [
    CommonModule,
    MaterialModule.forRoot(),
  ],
  declarations: [
    TdJsonFormatterComponent,
  ],
  exports: [
    TdJsonFormatterComponent,
  ],
})
export class CovalentJsonFormatterModule {
  static forRoot(): ModuleWithProviders {
    return {
      ngModule: CovalentJsonFormatterModule,
      providers: [],
    };
  }
}
github rangle / angular-ssr / examples / cli / src / app / app.module.ts View on Github external
import {MaterialModule} from '@angular/material';

import {Subscription} from 'rxjs/Subscription';

import {AppComponent} from './app.component';

import {DialogContent} from './dialog-content.component';

@NgModule({
  imports: [
    BrowserAnimationsModule,
    BrowserModule,
    CommonModule,
    FormsModule,
    HttpModule,
    MaterialModule.forRoot(),
  ],
  declarations: [
    AppComponent,
    DialogContent
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {}
github ajtowf / ng2_play / src / app / app.module.ts View on Github external
import { DataService } from './shared';

@NgModule({
  declarations: [
    AppComponent,
    HomeComponent,
    TodoComponent,
    AboutComponent,
    ProfileComponent,
    MaterialComponent
  ],
  imports: [
    BrowserModule,
    ReactiveFormsModule,
    HttpModule,
    MaterialModule.forRoot(),
    Ng2PlayRoutingModule
  ],
  providers: [
    {
      provide: AuthConfig,
      useFactory: () => {
        return new AuthConfig();
      },
      deps: [Http]
    },
    AuthHttp,
    AuthGuard,
    DataService
  ],
  bootstrap: [AppComponent]
})
github fegyi001 / mangol / src / lib / modules / map / map.module.ts View on Github external
import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MaterialModule } from '@angular/material';

import {MangolMapComponent} from './map.component';

@NgModule({
  imports: [
    CommonModule,
    MaterialModule.forRoot()
  ],
  exports: [
    MangolMapComponent
  ],
  declarations: [
    MangolMapComponent
  ]
})
export class MangolMapModule { 
  static forRoot(): ModuleWithProviders {
    return {
      ngModule: MangolMapModule,
      providers: []
    };
  }
}
github wpcfan / awesome-tutorials / angular2 / ng2-tut / src / app / app.module.ts View on Github external
import { CoreModule } from './core/core.module';
import { AppRoutingModule } from './app-routing.module';
import { TodoModule } from './todo/todo.module';
import { LoginModule } from './login/login.module';
import { AppComponent } from './app.component';
import 'hammerjs';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    CoreModule,
    AppRoutingModule,
    MaterialModule.forRoot(),
    FlexLayoutModule,
    LoginModule,
    TodoModule
  ],
  bootstrap: [
    AppComponent
    ]
})
export class AppModule { }
github Gbuomprisco / ng2-expansion-panels / demo / app.ts View on Github external
import { NgModule } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MaterialModule } from '@angular/material';
import { TagInputModule } from 'ng2-tag-input';
import { Home } from './home/home';
import { ExpansionPanelsModule } from '../modules/ng2-expansion-panels.module';

@NgModule({
    imports: [
        BrowserModule,
        FormsModule,
        ReactiveFormsModule,
        MaterialModule.forRoot(),
        TagInputModule,
        ExpansionPanelsModule
    ],
    bootstrap: [ Home ],
    declarations: [ Home ]
})
export class AppModule {
}
platformBrowserDynamic().bootstrapModule(AppModule);
github tarlepp / angular-firebase-material-demo / src / app / about / about.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [
        AboutComponent,
        AboutListComponent,
      ],
      imports: [
        MaterialModule.forRoot(),
      ],
      providers: [
        AnimationsService,
      ],
    })
    .compileComponents();
  }));
github stbui / angular-material-app / src / app / chat / chat.module.ts View on Github external
import { ChatService } from './chat.service';

import { InMemoryWebApiModule } from 'angular-in-memory-web-api';
import { InMemoryUserDbService } from './data/user';

import { ChatComponent } from './chat.component';
import { UserComponent } from './user/user.component';
import { ContactsComponent } from './contacts/contacts.component';
import { ChatsComponent } from './chats/chats.component';


@NgModule({
  imports: [
    CommonModule,
    FlexLayoutModule,
    MaterialModule.forRoot(),
    RoutingModule,
    InMemoryWebApiModule.forRoot(InMemoryUserDbService)
  ],
  providers: [
    { provide: 'ChatService', useClass: ChatService }
  ],
  declarations: [ChatComponent, UserComponent, ContactsComponent, ChatsComponent]
})
export class ChatModule { }
github apache / incubator-dlab / services / self-service / src / main / resources / webapp / src / app / resources / resources-grid / index.ts View on Github external
export * from './create-resource.model';
export * from './filter-configuration.model';

@NgModule({
  imports: [
    CommonModule,
    ComputationalResourcesModule,
    ModalModule,
    ConfirmationDialogModule,
    DetailDialogModule,
    ComputationalResourceCreateDialogModule,
    FormControlsModule,
    CostDetailsDialogModule,
    InstallLibrariesModule,
    InstallLibsModule,
    MaterialModule.forRoot()
  ],
  declarations: [ResourcesGridComponent],
  exports: [ResourcesGridComponent]
})

export class ResourcesGridModule { }