angular-material2

Disable animation in Angular 2 Material

强颜欢笑 提交于 2019-12-05 02:39:58
My question is how we can disable button or checkbox animation in angular material widgets? There are some css solutions to override transition with none but it s not working. Thanks, Lokesh Daiya You can disable animation using @.disabled property which is introduced in angular 4.3.1 . Either add below code to your component @HostBinding('@.disabled') disabled = true or in your html <div [@.disabled]="expression"></div> Here is working plnkr https://plnkr.co/edit/sVJM8H?p=preview try this: <mat-group [@.disabled]="true"> <mat-tab label="one">one</mat-tab> <mat-tab label="two">two</mat-tab>

Mat-select panel min-width

删除回忆录丶 提交于 2019-12-05 02:19:07
问题 I'm trying to customize mat-select with multiple checkboxes. for some reason the panel get wrong min-width as below: and I don't know where its calculating this min-width. also I tried to add panelClass and override the min-width from this class, for example: <mat-select #multipleSelect (selectionChange)="selectItem($event.value)" panelClass="multiple-panel" multiple> &.multiple-panel { min-width: 200px !important; } but when opening the dropdown its open with the original width (like in the

Angular 2 Material can't load style

一个人想着一个人 提交于 2019-12-05 02:08:34
I'm starting to develop an web app in Angular using the Angular Material library for the interface. But I'm getting an error when trying to import a prebuilt theme. In order to import it, I added <link rel="stylesheet" href="../node_modules/@angular/material/prebuilt-themes/indigo-pink.css"> to my index.html file but when i run ng serve I cannot get the file. If you are using angular-cli follow their steps for including Angular-Material . Ensure you have the below imports in src/styles.css @import '~@angular/material/prebuilt-themes/deeppurple-amber.css'; @import '~https://fonts.googleapis.com

How do you create a nested, collapsing menu with Angular Material2?

淺唱寂寞╮ 提交于 2019-12-05 01:33:28
I am looking for support within Angular Material2 for nested menus within a sidebar. The top level would typically be closed by default, and opening a top level would expose nested menu items. I thought this made sense as a starting point, but the child nav items render (poorly) outside of the parent items: plnkr <md-sidenav-container class="my-container"> <md-sidenav #sidenav class="my-sidenav"> <md-list> <md-list-item> <h3 md-line> First Parent </h3> <md-nav-list> <a md-list-item href="#">First Child</a> <a md-list-item href="#">Second Child</a> <a md-list-item href="#">Third Child</a> </md

Should I use Material for Angular or Material for AngularJS?

安稳与你 提交于 2019-12-05 01:23:09
Angular's GitHub page shows two pinned repositories relating to Material Design: angular/material2 angular/material The README.md for angular/material is titled Material Design for AngularJS Apps . The README.md for angular/material2 is titled Material Design for Angular . I'm building an Angular2 web application using the angular-cli and have both installed and imported @angular/material into app.module.ts . import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { HttpModule } from '@angular/http'; import { MaterialModule } from '@angular

Background color does not switch between light and dark themes in Angular material 2

陌路散爱 提交于 2019-12-05 01:10:45
问题 I have an Angular 4 app using Material 2 (current version, 2.0.0-beta.11). I have followed the documentation for theming and created two themes, a light theme and a dark theme. Since I do not use a md-sidenav component, I have put the mat-app-background class on the body element, which applies the current theme's background color (a light grey for a light theme, and a dark grey for a dark theme.) The problem is that when my theme switcher is toggled (a simple button that adds or removes a

angular-material2 toolbar shadow

坚强是说给别人听的谎言 提交于 2019-12-05 01:04:04
I am new to material2 I am trying to keep the the main app toolbar fixed on the top of the screen the problem is that the elevation is not working correctly (the content hides the drop shadow of the toolbar) I Here is my HTML code .app-content { height: calc(100% - 64px); overflow: auto; } <md-toolbar class="mat-elevation-z5" color="primary" style="z-index: 100!important;"> <button md-icon-button (click)="start.open()"> <md-icon class="demo-toolbar-icon">menu</md-icon> </button> <span>E-Learning</span> <span class="demo-fill-remaining"></span> </md-toolbar> <div class="app-content" style="z

Angular 4 - material 2 - md datepicker set first day of the week

风格不统一 提交于 2019-12-05 00:20:56
How to set first day of the week using material 2? Currently the default is sunday even if I set the locale to hu or anything else.. Béla Olcsán Found a workaround: Write this class import {NativeDateAdapter} from '@angular/material'; import {Injectable} from '@angular/core'; @Injectable() export class MyDateAdapter extends NativeDateAdapter { getFirstDayOfWeek(): number { return 1; } } Then import to the app.module like: {provide: DateAdapter, useClass: MyDateAdapter}, Pretty much the sam answer as Béla but I had to implement the constructor to get it working. import { NativeDateAdapter }

Switch between vertical and horizontal stepper material

巧了我就是萌 提交于 2019-12-04 22:35:55
How to switch between mat-vertical-stepper and mat-horizontal-stepper from angular component with same stepper steps? to avoid rewriting identical html content, do like this. Create the template and give them a reference using a #hashtag . then you can instert them using ng-container *ngTemplateOutlet="hashtag"></ng-container> . here is an example of making a responsive stepepr, the angular material way. <ng-template #stepOne> <div>step one</div> </ng-template> <ng-template #stepTwo> <div>step two</div> </ng-template> <ng-template #stepThree> <div>step three</div> </ng-template> <ng-template

material 2 Autocomplete: select option

99封情书 提交于 2019-12-04 22:22:46
I want to call a function when an option is selected. After some search it seem that i have to use : property optionSelections of MdAutocompleteTrigger In the documentation : https://material.angular.io/components/component/autocomplete optionSelections Stream of autocomplete option selections. I dont understand that , what is a stream, how to implement this ? On md-option you can set "onSelect" <md-autocomplete #auto="mdAutocomplete"> <md-option (onSelect)="callSomeFunction()" *ngFor="let state of states" [value]="state.name">{{ state.name }}</md-option> </md-autocomplete> Since beta 3,