angular-material

Drag and Drop in Angular on complex board (matrix)

只谈情不闲聊 提交于 2020-12-08 02:02:55
问题 So I want to make my version of the Battleships game in Angular and to do that I need a 10x10 matrix in which I can drag and drop the ships ( if you played the game you know what I am talking about ) and I'm using the Angular Cdk but I cannot make it work at all. What I have tried so far is make a table out of divs, ships elements aside and drag and drop them on the board but I can't connect the two arrays because the array of ships is not nested and the board is. Edit: Here is the link to

Which Angular Material version should I install to be compatible with Angular4?

ε祈祈猫儿з 提交于 2020-12-07 06:44:15
问题 Which Angular Material version should I install to be compatible with Angular4? I have used below command to install angular Material on the top of Angular 4 project. npm install @angular/materail npm install @angular/cdk npm install @angular/animations While I try to run the app I am getting below error. /node_modules/@angular/cdk/observers/typings/observe-content.d.ts (33,22): Type 'ElementRef' is not generic. 回答1: I would advise you to update your project to the latest version of angular.

Need to display Nested JSON Object in Material Data Table

本秂侑毒 提交于 2020-12-04 05:16:36
问题 I need to display nested JSON Object coming from my backend as the column fields of my MatTableDataSource. This is my JSON Object: [{ "workstationId": 100, "assemblylineId": 100, "workstationDescription": "Testing1", "workstationTest": "Yes", "createdAt": "2019-03-20", "updatedAt": "2019-03-20", "assemblylines": [{ "assemblylineName": "assembly1" }] }, { "workstationId": 101, "assemblylineId": 100, "workstationDescription": "workstation1", "workstationTest": "No", "createdAt": "2019-04-04",

Need to display Nested JSON Object in Material Data Table

ぐ巨炮叔叔 提交于 2020-12-04 05:11:48
问题 I need to display nested JSON Object coming from my backend as the column fields of my MatTableDataSource. This is my JSON Object: [{ "workstationId": 100, "assemblylineId": 100, "workstationDescription": "Testing1", "workstationTest": "Yes", "createdAt": "2019-03-20", "updatedAt": "2019-03-20", "assemblylines": [{ "assemblylineName": "assembly1" }] }, { "workstationId": 101, "assemblylineId": 100, "workstationDescription": "workstation1", "workstationTest": "No", "createdAt": "2019-04-04",

Need to display Nested JSON Object in Material Data Table

℡╲_俬逩灬. 提交于 2020-12-04 05:10:57
问题 I need to display nested JSON Object coming from my backend as the column fields of my MatTableDataSource. This is my JSON Object: [{ "workstationId": 100, "assemblylineId": 100, "workstationDescription": "Testing1", "workstationTest": "Yes", "createdAt": "2019-03-20", "updatedAt": "2019-03-20", "assemblylines": [{ "assemblylineName": "assembly1" }] }, { "workstationId": 101, "assemblylineId": 100, "workstationDescription": "workstation1", "workstationTest": "No", "createdAt": "2019-04-04",

How to change Mat-Datepicker date format to DD/MM/YYYY in simplest way?

泄露秘密 提交于 2020-12-02 05:55:55
问题 I'm setting up a mat-datepicker for DOB and traditionally the display format is MM/DD/YYYY,I need to change it to DD/MM/YYYY with less coding I tried format tag in mat-date picker but it does not work,other date pickers like ngbDatepicker format can easily changed through one line of coding <div class="col-md-3 Dinline-block"> <mat-form-field> <input matInput [matDatepicker]="picker2" [max]="currentDate" placeholder="DOB(DD/MM/YYYY)" required formControlName="dob" readonly /> <mat-datepicker

Angular Material Input and select in one form field

点点圈 提交于 2020-12-01 10:47:56
问题 I want the input field and the drop down field in the same area like the one on the left (I did this on the inspector) No matter what class I put in my stylesheet it won't shrink the size of the select menu. This is the html code I have. <mat-form-field appearance="outline"> <mat-label>End Time</mat-label> <input matInput type="time" placeholder="HH:MM" id="end_time_hour" [formControl]="timeFormControl"> <mat-select name="ampm" class="ampm" [(ngModel)]="event.eampm"> <mat-option value="AM">AM

Angular Material Input and select in one form field

試著忘記壹切 提交于 2020-12-01 10:43:53
问题 I want the input field and the drop down field in the same area like the one on the left (I did this on the inspector) No matter what class I put in my stylesheet it won't shrink the size of the select menu. This is the html code I have. <mat-form-field appearance="outline"> <mat-label>End Time</mat-label> <input matInput type="time" placeholder="HH:MM" id="end_time_hour" [formControl]="timeFormControl"> <mat-select name="ampm" class="ampm" [(ngModel)]="event.eampm"> <mat-option value="AM">AM

Angular Material Input and select in one form field

牧云@^-^@ 提交于 2020-12-01 10:41:12
问题 I want the input field and the drop down field in the same area like the one on the left (I did this on the inspector) No matter what class I put in my stylesheet it won't shrink the size of the select menu. This is the html code I have. <mat-form-field appearance="outline"> <mat-label>End Time</mat-label> <input matInput type="time" placeholder="HH:MM" id="end_time_hour" [formControl]="timeFormControl"> <mat-select name="ampm" class="ampm" [(ngModel)]="event.eampm"> <mat-option value="AM">AM

How to make a 'mat-select' readonly?

别说谁变了你拦得住时间么 提交于 2020-12-01 09:16:10
问题 I am working on a angular 5 project. There are many mat-select elements which is supposed to be readonly like text boxes. I found out that there is a disabled feature which is: <mat-form-field> <mat-select placeholder="Choose an option" [disabled]="disableSelect.value"> <mat-option value="option1">Option 1</mat-option> <mat-option value="option2" disabled>Option 2 (disabled)</mat-option> <mat-option value="option3">Option 3</mat-option> </mat-select> </mat-form-field> which out put looks like