angular-material2

Angular Material 7 Multi Select - Set selected value

 ̄綄美尐妖づ 提交于 2019-12-08 07:33:15
问题 I'm trying to set the selected value for multi select drop-down as below //loop to make a multiple check boxes as selected & setting based on condition document.getElementsByTagName('mat-pseudo-checkbox')[index].classList.add('mat-pseudo-checkbox-checked'); document.getElementsByTagName('mat-pseudo-checkbox')[index].setAttribute("ng-reflect-state","checked"); this only reflects the change cosmetically since when i try to retrieve all the selected checkbox through (selectionChange)=filter(

getting angular material table to work properly with api call

核能气质少年 提交于 2019-12-08 06:33:54
问题 I am trying to get Angular material table to work with an api call to my database I get the right data I just want to display with the new material table and for some reason this is not working as expected. this is my main component import { Component } from '@angular/core'; import {AosService} from './app.aos.service.component' import {QuoteModel} from './QuoteModel' import {DataSource} from '@angular/cdk'; @Component({ selector: 'app-aos', providers: [AosService], templateUrl: './app.aos

Angular Material 7 Multi Select - Set selected value

[亡魂溺海] 提交于 2019-12-08 04:49:27
I'm trying to set the selected value for multi select drop-down as below //loop to make a multiple check boxes as selected & setting based on condition document.getElementsByTagName('mat-pseudo-checkbox')[index].classList.add('mat-pseudo-checkbox-checked'); document.getElementsByTagName('mat-pseudo-checkbox')[index].setAttribute("ng-reflect-state","checked"); this only reflects the change cosmetically since when i try to retrieve all the selected checkbox through (selectionChange)=filter($event) <mat-select multiple (selectionChange)="filter($event)" formControlName="dropdown"> <mat-option

Target specific element style by Id or Class inside angular material 2 element using CSS

纵饮孤独 提交于 2019-12-08 04:30:29
I am having an EntryComponent that has a material button menu. When I try to override the default style by using ::ng-deep the styling changes for all the button component in the parent Component as well. <style> ::ng-deep .mat-button{ max-width: 50px !important; min-width: 45px !important; height: 5em; } ::ng-deep .mat-button-ripple mat-ripple{ max-width: 40px !important; min-width: 20px !important; } </style> I also tried to target styling using a class but it doesn't work like usual CSS I guess. <style> .actions ::ng-deep .mat-button{ max-width: 50px !important; min-width: 45px !important;

How can i make icon and placeholder in same line using material?

不羁岁月 提交于 2019-12-08 04:18:38
问题 I want to make icon and search field should be in same line . <div class="example-header"> <mat-form-field> <mat-icon>search</mat-icon> <input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter"> </mat-form-field> </div> Above i added my html code .. demo i wrote lot of css but i could't get this help me out to move forward.. 回答1: Not sure why other answers are so complicated. Just use matPrefix or matSuffix with mat-button (tested for Angular-material v7). Straight from

Using separate components in a linear mat-horizontal-stepper

眉间皱痕 提交于 2019-12-08 02:48:03
问题 In Angular, is it possible to have a linear stepper where the individual steps are separate components? For example: <mat-horizontal-stepper [linear]="isLinear"> <mat-step [stepControl]="firstFormGroup" label="Some Form"> <first-component></first-component> </mat-step> <mat-step [stepControl]="secondFormGroup" label="Another Form"> <second-component></second-component> </mat-step> <mat-step [stepControl]="thirdFormGroup" label="Review"> <third-component></third-component> </mat-step> </mat

How to Map Dynamic Header and table content in Angular2 Material Table

馋奶兔 提交于 2019-12-08 00:08:49
问题 I am getting issue in Angular material table with dynamic table content and header. Here is my JSON data for table. let dataobj=[ [ { "key": "Data1", "value": "ENF" }, { "key": "Data2", "value": "10598489700" }, { "key": "Data3", "value": "3662946630" }, { "key": "Comments", "value": "" }, { "key": "Readonly", "value": "true", "index": 0 } ], [ { "key": "Data1", "value": "FNS" }, { "key": "Data2", "value": "10598489700" }, { "key": "Data3", "value": "3662946630" }, { "key": "Comments", "value

Not able to use a custom theme in Angular 4

江枫思渺然 提交于 2019-12-07 22:58:30
问题 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 '~

Placing Amazon Banner | Angular V4

淺唱寂寞╮ 提交于 2019-12-07 20:45:28
问题 I'm placing an Amazon banner inside an angular material 2 card.But the problem is that it is not rendering.It shows empty div.What could be the reason.Below is the code showing how I did it. <md-card class="full-width full-height border-box "> <div class="adv"> <script type="text/javascript" language="javascript"> var aax_size = '728x90'; var aax_pubname = 'XXXXXXXXXXX'; var aax_src = '302'; </script> <script type="text/javascript" language="javascript" src="http://c.amazon-adsystem.com/aax2

Mat expansion panel is not working properly in mat tab

你。 提交于 2019-12-07 18:06:45
问题 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. 回答1: 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