angular-material

Error: Cannot find module '@angular-devkit/schematics' and Cannot find module '@angular-devkit/schematics'

不打扰是莪最后的温柔 提交于 2020-02-28 04:21:53
问题 When I try to generate angular material data-table, I am getting below error. Please guide me to resolve this error. ng command used for generate the data-table: ng g @angular/material:material-table --name=data-table after executing above ng command I am getting below error in my terminal Cannot find module '@angular-devkit/schematics' Error: Cannot find module '@angular-devkit/schematics' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15) at Function.Module._load

Error: Cannot find module '@angular-devkit/schematics' and Cannot find module '@angular-devkit/schematics'

醉酒当歌 提交于 2020-02-28 04:21:19
问题 When I try to generate angular material data-table, I am getting below error. Please guide me to resolve this error. ng command used for generate the data-table: ng g @angular/material:material-table --name=data-table after executing above ng command I am getting below error in my terminal Cannot find module '@angular-devkit/schematics' Error: Cannot find module '@angular-devkit/schematics' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15) at Function.Module._load

how to pass data from angular material dialog to parent component?

旧城冷巷雨未停 提交于 2020-02-27 05:19:42
问题 I'm using angular 6 and I have a button which opens a dialog. in my dialog, I have a form that gets user's data and then I have two buttons to submit and cancel. I tried to show my form's data in the console but it returns undefined! whats the problem? here is part of codes: main.component.ts: import { Work } from '../../../../classes/work_shift'; import { DialogContentComponent} from './dialog-content/dialog-content.component'; export class WorkShiftsComponent implements OnInit { shifts:

How to set width of mat-table column in angular?

风流意气都作罢 提交于 2020-02-26 07:52:42
问题 Here in my mat-table have 6 column when any column has not more words then it looks like Image-1, but when any column has more words then UI looks like Image-2, so how to set UI like Image-1 when any column has more words in angular 6 ? Image-1 Image-2 user.component.html <div class="mat-elevation-z8"> <table mat-table [dataSource]="dataSource"> <ng-container matColumnDef="userimage"> <th mat-header-cell *matHeaderCellDef> # </th> <td mat-cell *matCellDef="let element"> <img src="{

How to set width of mat-table column in angular?

独自空忆成欢 提交于 2020-02-26 07:51:35
问题 Here in my mat-table have 6 column when any column has not more words then it looks like Image-1, but when any column has more words then UI looks like Image-2, so how to set UI like Image-1 when any column has more words in angular 6 ? Image-1 Image-2 user.component.html <div class="mat-elevation-z8"> <table mat-table [dataSource]="dataSource"> <ng-container matColumnDef="userimage"> <th mat-header-cell *matHeaderCellDef> # </th> <td mat-cell *matCellDef="let element"> <img src="{

Adding manual validation on angular mat form field

大兔子大兔子 提交于 2020-02-26 04:06:08
问题 I am working on a angular application and using mat form fields in it. My code for mat form field including validation is as follows. <mat-form-field appearance="fill"> <mat-label> {{ Email }}</mat-label> <input formControlName="email"> <mat-error *ngIf="service.form.get('email').hasError('maxlength')">{{ 'Display.messageLength' }}</mat-error> <mat-error *ngIf="service.form.get('email').hasError('required')">{{ 'Display.requiredMessage' }}</mat-error> </mat-form-field> Now in TS file I have a

Angular Material Datepicker with Range Selection

爷,独闯天下 提交于 2020-02-25 04:37:05
问题 I'm using angular 8 and I wanted implement a datepicker with daterage highlighted: enter image description here I was looking for some package like this one: https://www.npmjs.com/package/saturn-datepicker Unfortunately it has been deprecated and currently I cannot find others like that. Do you know something for my purpose? Thank you. 回答1: IMPORTANT UPDATE , My good!! google is plenty full of controls like mine! (remember: Google is my friend, google is my friend...) I'm making a datePicker

Can't bind to 'configuration' since it isn't a known property of 'ng-material-multilevel-menu'

℡╲_俬逩灬. 提交于 2020-02-25 04:20:10
问题 The bounty expires in 7 days . Answers to this question are eligible for a +50 reputation bounty. Arvind Chourasiya wants to draw more attention to this question: “If anybody knows please provide me answer.” I am using ng-material-multilevel-menu plugin to create multilevel dropdown. I am following this article, but getting below runtime error Can't bind to 'configuration' since it isn't a known property of 'ng-material-multilevel-menu'. 1. If 'configuration' is an Angular directive, then add

How to change background color of specific angular material tabs?

若如初见. 提交于 2020-02-25 04:06:34
问题 I have a component using mat tab from angular material 7. I want to change the background color of my tabs depending on a boolean value of my typescript variable. The problem is that I can only apply the CSS on all tabs with .mat-tab-label { background-color: red; } How to create a CSS class which I can apply on a specific tab. I have a standard component. I tried using encapsulation: ViewEncapsulation.None but this only allowed me to change all tabs as mentioned above. HTML: <mat-tab-group

Angular Material 2 container

天大地大妈咪最大 提交于 2020-02-24 12:41:48
问题 I'm new to Angular material 2 and I'm accustomed to using bootstrap 4.1. So this question may seem simple, but how does one create a "container" in Angular material 2? For example in a bootstrap container in will create a left and right margin for the entire app, can this be achieved easily with Angular material 2? 回答1: Well it all depends on your layout. If you have all your content in one card, you don't need to mind about anything, the card will be nicely displayed thanks to its set width.