angular2-material

Cannot find name 'HammerManager'

喜你入骨 提交于 2019-12-05 04:17:01
I am using @angular-2.0.0-rc.5, @angular2-material 2.0.0-alpha.7-4 & Angular-CLI 1.0.0-beta.11-webpack.2 When I try to compile it throws an error, Cannot find name 'HammerManager'. Please see attached screenshot. I found some solution for Angular-CLI (non-webpack) version but none for webpack version with. Any one got this fixed with above setup ? You'll need to install the missing typings: npm install @types/hammerjs --save-dev Then put a reference to the hammerjs typings into your tsconfig.json : "types": [ ..., "hammerjs" ] if that's not enough, also install hammerjs itself via npm: npm i

Angular2 app module with root level imports

会有一股神秘感。 提交于 2019-11-29 03:18:28
Shouldn't imports on the root level be available globally (With globally I mean to all sub-modules and components)? I have the following root/app module : import { BrowserModule } from '@angular/platform-browser'; import { NgModule, ApplicationRef } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { AppComponent } from './app.component'; import { HttpModule } from '@angular/http'; import { RouterModule } from '@angular/router'; import { appRouterProviders, routing } from './app.routes'; import { DashboardModule } from '.

Angular2 app module with root level imports

自古美人都是妖i 提交于 2019-11-27 22:05:23
问题 Shouldn't imports on the root level be available globally (With globally I mean to all sub-modules and components)? I have the following root/app module : import { BrowserModule } from '@angular/platform-browser'; import { NgModule, ApplicationRef } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { AppComponent } from './app.component'; import { HttpModule } from '@angular/http'; import { RouterModule } from '@angular

Importing modules with forRoot()

ε祈祈猫儿з 提交于 2019-11-27 19:30:17
I am going through the example of Angular2 Material and I see that all Material modules are imported in the root module using the forRoot() method. So in my app I do the same. Now I need to use some Material components within other Shared modules, which means that I need to import the related Material packages in my Shared module. I am not clear whether I need to use the forRoot() method also while importing them in the Shared module. Thanks in advance for any help forRoot is only used for the main app module. It is a convention used so that only the app module gets application/singleton