angular-material

How to change angular material stepper step numbers to any icon or text?

谁都会走 提交于 2019-12-22 08:07:15
问题 Angular Material Stepper has following problems for me which I can not found from documentation. How can I display any string or html instead of stepper index numbers? How can display matToolTip when mouse hover any mat step? I am using latest version of Material Angular IO. 回答1: Unfortunately, right now it is impossible to override the number using native hooks from material. One possible solution is to use css to overwrite the value. Here we hide the current symbol and use our own text

keep mat-menu open angular

泄露秘密 提交于 2019-12-22 08:01:39
问题 I am trying to use checkbox options in a menu, but I need to keep the menu open until the user is finished selecting options. I am using the latest version of Angular. Thank you in advance! I have combined the nested mat-menu from here with checkboxes: What I have tried, but the menu closes after a checkbox is selected: <mat-menu #worldtest="matMenu" md-prevent-menu-close="md-prevent-menu-close"> <section><mat-checkbox class="example-margin" [(ngModel)]="checked">Checked</mat-checkbox><

Angularjs : Scroll to bottom of div

孤街浪徒 提交于 2019-12-22 06:47:34
问题 I'm having trouble scrolling to last message. var app=angular.module('myApp', ['ngMaterial'] ); app.controller('ChatCtrl', function($window, $anchorScroll){ var self = this; self.messageWindowHeight = parseInt($window.innerHeight - 170) + 'px'; self.messages = []; for(var i = 1 ; i<=200;i ++){ self.messages.push(i); } self.user = { text : ""}; self.send = function(){ self.messages.push(angular.copy(self.user.text)); self.user.text = ""; } }); app.directive('scrollToBottom', function($timeout,

Angularjs : Scroll to bottom of div

随声附和 提交于 2019-12-22 06:46:27
问题 I'm having trouble scrolling to last message. var app=angular.module('myApp', ['ngMaterial'] ); app.controller('ChatCtrl', function($window, $anchorScroll){ var self = this; self.messageWindowHeight = parseInt($window.innerHeight - 170) + 'px'; self.messages = []; for(var i = 1 ; i<=200;i ++){ self.messages.push(i); } self.user = { text : ""}; self.send = function(){ self.messages.push(angular.copy(self.user.text)); self.user.text = ""; } }); app.directive('scrollToBottom', function($timeout,

Current selected value in angular6 material mat-selection-list

断了今生、忘了曾经 提交于 2019-12-22 06:45:05
问题 Working with Angular Material2 mat-selection-list , Able to identify whether current option is selected or non-selected[Boolean]. compnenent.html <mat-selection-list #shoes (selectionChange)="onSelection($event, shoes.selectedOptions)" > <mat-list-option *ngFor="let shoe of typesOfShoes" [value]='shoe'> {{shoe}} </mat-list-option> </mat-selection-list> component.ts export class ListSelectionExample { typesOfShoes = ['Boots', 'Clogs', 'Loafers', 'Moccasins', 'Sneakers']; onSelection(e, v){

Angular Material - Getting index of row in data table

早过忘川 提交于 2019-12-22 06:42:51
问题 I am using the MatTable component from Angular Material to make a dynamic data table. I need to get the current position of a row. I can easily get the row on which the user clicked but I am unable to know its current position in the list (which depends on sort/filtering/pagination). Any idea? 回答1: in your mat-cell you can get index like *ngFor as below <mat-cell *matCellDef="let element;let i = index;"> {{ i }} </mat-cell> Update from Angular 5 use also index as i <ng-container matColumnDef=

Set default value for angular material datePicker with angular 5

旧街凉风 提交于 2019-12-22 05:07:02
问题 I'm using a date picker from angular material. I want to set a default value but it is not showing the value. <mat-form-field class="mr-sm-24" fxFlex (click)="open()" > <input matInput [picker]="picker" placeholder="Date" autocomplete="off" name="date" formControlName="date"> <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle> <mat-datepicker [startAt]="startDatePicker" #picker></mat-datepicker> </mat-form-field> this is my .js code with the value that i want to set as

Angularjs with material design Failed to instantiate module ngMaterial

自闭症网瘾萝莉.ら 提交于 2019-12-22 04:58:16
问题 I have installed angularjs and materialjs using bower. bower install angular-material And injected 'ngMaterial' into my app but getting this error. Uncaught Error: [$injector:modulerr] Failed to instantiate module demoApp due to: Error: [$injector:modulerr] Failed to instantiate module ngMaterial due to: Error: [$injector:modulerr] Failed to instantiate module material.core due to: Error: [$injector:unpr] Unknown provider: $mdUtilProvider Any Help. 回答1: I had the same problem until I changed

How to show spinner in angular 6

扶醉桌前 提交于 2019-12-22 04:49:07
问题 I am new to angular and web development but able to design various web pages and got data from the server using HTTP client module. While getting data from server I want to show progress spinner, but I am not able to do it. I have searched google but nothing made me to do it. Please help me to achieve this. Code: login.component.ts userLogin() { console.log('logging in'); this.eService.signIn(this.user_name, this.password) .subscribe( data => { console.log(data); this.admin = data; if ( this

Angular 6 Material: mat-tab-link be selected by underlining bar

北慕城南 提交于 2019-12-22 04:47:18
问题 I have a mat-tab-nav-bar navigation bar for my website, but the mat-tab-link blue underlining bar won't chase the active button. It just stays at the first button, and doesn't move. The buttons do turn into active state though in the sense that the background color changes, and they route well to their corresponding pages. Here's the app.component.ts : import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app