angular2-material

Angular 2 Material: same icon from same file displays in one component, not the other

佐手、 提交于 2020-01-07 08:11:28
问题 I'm using Angular 2 rc 5 with ng2-Material alpha 7-2 . The basic problem is that using <md-icon svgIcon='icon'> to show the same icon from the same svg file will work in one component but not the other even though MdIconModule and MdIconRegistry are provided to the root AppModule To replicate the problem Open this plunker Notice that MdIconModule and MdIconRegistry are imported as part of MaterialModule.forRoot() into the main AppModule Open the AppComponent and notice the call to

Angular 2 - Cannot read property 'AssetUrl' of undefined

你离开我真会死。 提交于 2020-01-05 04:03:18
问题 I am new at angular2 and material-design . I am trying to use them togeather. I cloned this material2-app, which is application code based on angular2 and material2 and run npm install . When I run this command npm start to start a server. I got this error. Any Leads ? Error-from-terminal > m2-app@0.0.0 start /home/adil/Code/AngularJS.2/a-simple-app/material2-app > ng serve Cannot read property 'AssetUrl' of undefined TypeError: Cannot read property 'AssetUrl' of undefined at Object.

Sticky MdToolbar inside MdSidenavLayout

有些话、适合烂在心里 提交于 2020-01-01 05:18:08
问题 I have an Angular 2 Material app that uses the <md-sidenav-layout> with an <md-toolbar> inside. <md-sidenav-layout> <md-sidenav #sidenav mode="side" class="app-sidenav" opened="true"> sidenav content </md-sidenav> <md-toolbar color="primary" class="toolbar"> toolbar content </md-toolbar> </md-sidenav-layout> And it looks like this What I'm trying to do is have the toolbar stick to the top so it doesn't move when you scroll down. This is to make it consistent with the sidenav and its title.

Importing modules with forRoot()

烈酒焚心 提交于 2019-12-17 15:39:14
问题 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 回答1: forRoot is only used

Handling dollars in Angular 2 Material Slider

我的未来我决定 提交于 2019-12-12 01:29:21
问题 I have a form in my Angular 2 Material application with, among other things, a price field modeled as a slider with a maximum, minimum, and step: <md-input type="range" [min]="minimumPrice" [max]="maximumPrice" [step]="priceTick" class="slider"> Prices are modeled in cents (i.e. with no fractions), but the front-end should display prices in dollars , e.g., a price of 12345 cents with a maximum of 50000 cents, a minimum of 0 cents, and a step of 5 cents looks like this now: 12345 0 |---------*

Angular2 Material: Md-Menu opens below router outlet

喜欢而已 提交于 2019-12-10 11:07:28
问题 When using md-menu with @angular/material, said menu opens below my router outlet no matter how i stack the components. What am i missing here? app.modules.ts import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; import { RouterModule, Router } from '@angular/router'; import { MaterialModule } from '@angular/material'; import { MdButtonModule } from '

Angular 2 Material How to update Dialog box Position?

我的梦境 提交于 2019-12-10 10:26:35
问题 Below is the simple Angular 2 code that should show dialog box in the middle out of the box. Instead dialog box show at the bottom. I am using "angular-cli": "1.0.0-beta.24" and "@angular/material": "^2.0.0-beta.1" Can anybody help why this is happening? import { Component } from '@angular/core'; import {MdDialog,MdDialogRef,MdDialogConfig} from '@angular/material'; @Component({ selector: 'app-root', template: ` <md-sidenav-container style="width:200px;height:500px;"> <md-sidenav mode="side"

How to integrate angular2-material (alpha 8.2) with angular2-Quickstart app

醉酒当歌 提交于 2019-12-08 05:11:24
问题 NOTE: I don't use Angular-CLI This plunker is working with Alpha-8.1 : https://plnkr.co/edit/qoZ3YCwSz0mQ5o974Dt0?p=preview I have my quick-start app running without any issue. Step 1 : I updated package.json to include angular2-material and angular2-button packages. package.json { "name": "angular2-quickstart", "version": "1.0.0", "scripts": { "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ", "lite": "lite-server", ... }, "license": "ISC", "dependencies": { "@angular/common

Cannot find name 'HammerManager'

三世轮回 提交于 2019-12-07 00:37:25
问题 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 ? 回答1: You'll need to install the missing typings: npm install @types/hammerjs --save-dev Then put a reference to the hammerjs typings into your

Angular2 Material: Md-Menu opens below router outlet

倖福魔咒の 提交于 2019-12-06 05:49:01
When using md-menu with @angular/material, said menu opens below my router outlet no matter how i stack the components. What am i missing here? app.modules.ts import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; import { RouterModule, Router } from '@angular/router'; import { MaterialModule } from '@angular/material'; import { MdButtonModule } from '@angular/material'; import { MdIconModule } from '@angular/material'; import { AppComponent } from './app