angular-material2

how to set text inside md-progress-spinner in Angular-4

£可爱£侵袭症+ 提交于 2019-12-06 05:54:33
In Angular-4 I am setting progress spinner like that <md-progress-spinner [color]="color" [mode]="mode" [value]="value" aria-label="Rating">Rating</md-progress-spinner> and the values in ts: color = 'warn'; mode = 'determinate'; value = 50; showText='Rating'; But I want to set some text inside the progress bar, I try to use angular-2 method but its not working in Angular-4 can anybody please tell me how its done in Angular-4 Angular-2 approach is to set [showText]='showText' This feature in not available in Material. You need to create it manually. You can place the <mat-progress-spinner>

How to implement Angular Material 2 Autocomplete with AJAX

元气小坏坏 提交于 2019-12-06 05:23:13
I am using Angular Material 2 Autocomplete in my Angular 4 project. How can I implement such that the autocomplete values are loading from an HTTP call, in this example ? Can anyone give me a Plunker demo? Thank you First of all, you should please show some attempt to solve your issue, but luckily I'm bored and will provide an answer ;) Here in this sample I'm using: https://jsonplaceholder.typicode.com/users we store that JSON result as an observable in users . Then we have our observable filteredUsers which will be shown in template. Since this is a http-request, we would want to use

Not able to use a custom theme in Angular 4

不羁岁月 提交于 2019-12-06 04:32:38
I'm trying to use my custom theme in my angular project. It's not working as expected, I get the following error: ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader?{"ident":"postcss"}!./src/custom_theme.scss Module not found: Error: Can't resolve '@angular/material/theming' in '/Users/mathiasschrooten/Downloads/skylux-admin/src' My styles.css file: @import "custom_theme.scss" .mat-tab-label { flex: 1 1 auto; } My custom_theme.scss file: @import '~@angular/material/theming'; @include mat-core(); $candy-app-primary: mat-palette($mat-orange); $candy-app

How to use EventEmitter(onClose) of the sidenav

别来无恙 提交于 2019-12-06 03:46:17
I want to check when my <md-sidenav> is getting closed. Is there a way to use the EventEmitter onClose of my sidenav object to check that? and can you give me an example? This is possible in 2 different ways - via the template, and within the component code itself. Assuming an HTML template such as the following: <md-sidenav-container> <md-sidenav #mySidenav (close)="onClose()" mode="side"> This is sidenav content </md-sidenav> <button md-raised-button (click)="mySidenav.toggle()">Toggle Sidenav</button> </md-sidenav-container> In your component you can have something like this: import {

angular material 2 custom component with ng value accessor

烂漫一生 提交于 2019-12-06 03:45:39
问题 I a working on angular 4.4 + material beta12 custom component and not able to figure out what is wrong in my implementation I am trying to achieve the below custom input Task: set value to formControl, once I got data from server(data.productTeam is data-can see in code) on edit, formcontrol should be updated with values (eg:P12DT2H231M) Issues: I am not able to bind default value to formcontrol. Without ngDefaultControl (No value accessor for form control with name: 'productTeam' error

MatPaginator gets undefined

被刻印的时光 ゝ 提交于 2019-12-06 02:56:24
问题 I have replicated thsi case: Angular 5 Material Table not getting data from service But when I try access any property from paginator I get undefined error from this objet. Any ideas? Thanks 回答1: I got the same issue. Placing mat-paginator tag outside *ngIf resolved my issue. Make sure it is available to component class without any conditions. 回答2: Some issues that may cause mat-paginator is undefined: You forgot to import in app.module.ts import { MatPaginatorModule } from '@angular/material

Angular Material 2 browser autofill for mat-select not working

南楼画角 提交于 2019-12-06 02:23:37
问题 I have a form that represents an address and I'm using mat-select for the state/province. Unfortunately it's not autofilling the state/province (I'm assuming because it's not a native select). Here is my markup: <mat-form-field> <mat-select placeholder="State" [(ngModel)]="state" autocomplete="billing address-level1"> <mat-option *ngFor="let s of states" [value]="s.abbreviation">{{ s.name }}</mat-option> </mat-select> </mat-form-field> I'm not sure if I'm missing something or if the browsers

Sticky toolbar material 2 and sidenav

偶尔善良 提交于 2019-12-06 00:20:59
问题 Started recently learning material 2 and ran to issue. My approach is to do a sidenav as in Youtube website. There is a hamburger menu on left which expands/collapses side menu. Code: <md-toolbar class="fixed-header"> <button class="app-icon-button" (click)="start.toggle()"> <i class="material-icons app-toolbar-menu">menu</i> </button> </md-toolbar> <md-sidenav-container> <md-sidenav #start class="app-sidebar" mode="side">test</md-sidenav> <div class="text"> {{ text }} </div> </md-sidenav

Angular 4 material md-input style css

我是研究僧i 提交于 2019-12-05 23:58:41
I have a input component from angular material: <input mdInput placeholder="Name" disabled floatPlaceholder="never"> I have two issue: How do I change the underline to bold from dotted when in disabled state? I know the APIs don't specifically say it but is there any way to to make the floatPlaceholder property work here. (The API only mentions the use of this property for md-select ). 1. How do I change the underline to bold from dotted when in disabled state? Use ViewEncapsulation to override default styles with your custom styles. In your component.css , add the following styles: .mat-form

Mat expansion panel is not working properly in mat tab

倖福魔咒の 提交于 2019-12-05 23:15:47
https://stackblitz.com/edit/angular-material2-issue-1vt6en?file=app/app.component.html Please check tab two it is not expanded properly. How to fix it. Firstly, consider updating your Angular dependencies to 6.x.x , where Angular Material has support for lazy-loading of tab content. From the docs for tabs : By default, the tab contents are eagerly loaded. Eagerly loaded tabs will initalize the child components but not inject them into the DOM until the tab is activated. If the tab contains several complex child components or the tab's contents rely on DOM calculations during initialization, it