angular-material2

Angular 5 with material autocomplete

喜你入骨 提交于 2019-12-11 05:06:40
问题 I have a problem in the autocomplete material, in the part of the [value] = "option.NameTypeProduct", what I want to pass is the id, try with option.id, it works but in the input I get the id, and I want you to name me, as I do to pass the id, and that the name keeps coming up. There is some way of doing what I say of passing the id parameter of the html without the name disappearing from the input. export class DetailproductcreateComponent implements OnInit { FormDetailProductCreate :

What is the best way to style using angular 2 material design

爷,独闯天下 提交于 2019-12-11 04:49:17
问题 I'm new to angular 2 material design the things i see was the 3 class primary, accent and warn that gives respective colors to the element, are these only things we can style out app using angular material 2? are there other class too? so that we can modify and use it for our purpose, or we have to style our app from scratch by making classes and attaching to the element, Also I want to use themes but i dnt know how to use it in angular 2 project, im following official documentation this I

Animation inside of MatDialog is not working

﹥>﹥吖頭↗ 提交于 2019-12-11 04:46:15
问题 I have component/dialog where I am going dynamically add/remove components. Also I do have animation on enter/leave so when component is removed and new component added I want to animate slide in slide out. But inside of MatDialog is not working. I thought issue is with animation but when I am inserting my component, which I am showing in dialog, to any other place which is rendered with Mat Dialog it works. <mat-dialog-content> <div [@swapComponent]="getStatus()" (@swapComponent.start)=

Use ngFor items to display another item before the first element

筅森魡賤 提交于 2019-12-11 04:23:23
问题 I would like to display an array using ngFor but before the first element I want to display a card (the user can click inside to show a modal) Here the code : <div fxFlex="25" *ngFor="let product of products; let i = index"> <div *ngIf="i == 0"> <mat-card (click)="addProduct()" class="mat-card-add-button"> <div fxLayout="row" fxLayoutAlign="center center" fxFlex="100%"> <span style="font-size:32px;text-align:center">+<br />Add product</span> </div> </mat-card> </div> <div fxLayoutAlign=

Could not find Angular Material core theme

ぃ、小莉子 提交于 2019-12-11 03:55:23
问题 I have added angular material2 package to my project. However, I get the following warning message in browser i have created a custom scss file and imported the packages still it throw's warning message: Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: material.es5.js?7d89:180 https://material.angular.io/guide/theming I have created styles.scss file and included following configuration file Package "

How to render list of items inside Mat-Menu Angular/material2

a 夏天 提交于 2019-12-11 03:14:25
问题 Back in materialc1 I was able to render a list of buttons inside my material menu as below: <md-menu> <md-button ng-click="vm.openMenu($mdMenu, $event)"> <md-icon md-svg-icon="extraIcons:toolbox" aria-label="Toolbox"></md-icon> </md-button> <md-menu-content> <md-menu-item ng-repeat="hi in vm.ListofPizza"> <md-button ng-click="vm.orderPizza(hi.id)"> {{hi.name}} </md-button> </md-menu-item> </md-menu-content> I am trying to do the same in material2/angular2 as shown below: <button mat-fab color

Set default option in md-select in angular material 2

孤者浪人 提交于 2019-12-11 01:47:50
问题 I am trying to set the default option in md-select of angular-material2 but to no avail. form2.component.ts: export class Form2Component implements OnInit { frequency = [ {"title" : "One Time", "description" : "", "discount" : {"value" : 0, "type" : "value"} }, {"title" : "Weekly", "description" : "", "discount" : {"value" : 20, "type" : "percent"} }, {"title" : "Every other Week", "description" : "", "discount" : {"value" : 15, "type" : "percent"} }, {"title" : "Monthly", "description" : "",

Changing tab text color on selection

若如初见. 提交于 2019-12-11 01:07:24
问题 I am working on Angular4 and have been using angular material. I have created a tab-group and I want to change the text color of a tab label when I select any tab. I have tried to override the default css but that didn't help me. I can override the ink bar but I am not able to override tab-text color upon selection .mat-ink-bar{ background-color:#00ADEE; } /*.mat-tab-label::selection{ color: #00ADEE !important; } */ The commented part which I was trying to change the color of a tab-label

How colSpan and row Span added to material table Header Angular 7?

笑着哭i 提交于 2019-12-11 00:15:24
问题 I'm trying to add rowSpan and colSpan in Angular material Table header . Can anyone help me to achieve it. Below is the Attached Header I want to get using material table 回答1: I have the sample task like you. I just easy to display none with second header. <ng-container matColumnDef="position"> <th mat-header-cell *matHeaderCellDef [ngStyle]="{'display': 'none'}"> No. </th> <td mat-cell *matCellDef="let element"> {{element.position}} </td> </ng-container> <!-- first stage header --> <ng

Angular mat-checkbox getElementById

末鹿安然 提交于 2019-12-10 23:17:57
问题 I've got a problem with the mat-checkbox from angular material. I've given the checkbox an ID like this: <mat-checkbox class="toolbar-checkbox" id="myCheckbox"> MyCheckbox </mat-checkbox> After that I'm trying to something with this element like this: (<MatCheckbox>document.getElementById('myCheckbox')).checked = true; But unfortunally I'm getting this error: TS2352: Type 'HTMLElement' cannot be converted to type 'MatCheckbox'. Property '_changeDetectorRef' is missing in type 'HTMLElement'. (