angular-material

Ionic 5 menu doesn't show up

耗尽温柔 提交于 2021-01-28 18:01:53
问题 I have a demo application where I want to insert a menu. Unfortunately I can't get this menu to appear in the header. I've tried different approaches, but I can't find the solution. My app.component.html looks like this: <ion-app> <app-header></app-header> <ion-router-outlet id="main-content"></ion-router-outlet> <app-footer></app-footer> </ion-app> My header.component.html like this: <ion-menu side="start" contentId="main-content"> <ion-header> <ion-toolbar color="primary"> <ion-buttons slot

Angular Material Table only display items when click on table

杀马特。学长 韩版系。学妹 提交于 2021-01-28 15:32:56
问题 Items only display on table, when I click on the table. When first time loading the page, the table is empty. I don't know why. I retrieve the data from Rest-API Cloud Blobstorage and then I fill the empty Array. here is the code: import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; import { MatTableDataSource } from '@angular/material/table'; Here I export interface PeriodicElement //name of table column export interface

Angular Material Table only display items when click on table

允我心安 提交于 2021-01-28 15:32:00
问题 Items only display on table, when I click on the table. When first time loading the page, the table is empty. I don't know why. I retrieve the data from Rest-API Cloud Blobstorage and then I fill the empty Array. here is the code: import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; import { MatTableDataSource } from '@angular/material/table'; Here I export interface PeriodicElement //name of table column export interface

Populating MatTables with promises (asynchronous rows)

自作多情 提交于 2021-01-28 14:49:20
问题 I'm trying to display a collection of objects in a MatTable. I have a list with each object's URL, so I want to populate the rows asynchronously (I'm ok with having all the empty rows upfront, and then fill in the data as I load it) So, this is my data source export class TableDataSource extends DataSource<Promise<any>> { private _items: Promise<any>[]; constructor(private loader: LoaderService, private collection: ObjectMember) { super(); } connect(): Observable<Promise<any>[]> { if (!this.

Populating MatTables with promises (asynchronous rows)

拜拜、爱过 提交于 2021-01-28 14:43:22
问题 I'm trying to display a collection of objects in a MatTable. I have a list with each object's URL, so I want to populate the rows asynchronously (I'm ok with having all the empty rows upfront, and then fill in the data as I load it) So, this is my data source export class TableDataSource extends DataSource<Promise<any>> { private _items: Promise<any>[]; constructor(private loader: LoaderService, private collection: ObjectMember) { super(); } connect(): Observable<Promise<any>[]> { if (!this.

Populating MatTables with promises (asynchronous rows)

那年仲夏 提交于 2021-01-28 14:39:22
问题 I'm trying to display a collection of objects in a MatTable. I have a list with each object's URL, so I want to populate the rows asynchronously (I'm ok with having all the empty rows upfront, and then fill in the data as I load it) So, this is my data source export class TableDataSource extends DataSource<Promise<any>> { private _items: Promise<any>[]; constructor(private loader: LoaderService, private collection: ObjectMember) { super(); } connect(): Observable<Promise<any>[]> { if (!this.

How in Angular Material to set values ​of “Y” and “N” for component checkbox?

筅森魡賤 提交于 2021-01-28 12:11:09
问题 The database I use does not use boolean values true and false. How in Angular Material to set values ​​of Y and N for component checkbox ? html: <mat-checkbox formControlName="IS_ACTIVE" (change)="checkboxChange($event.checked)"> Active </mat-checkbox> ts: public setValueOptions = { onlySelf: true, emitEvent: false, emitModelToViewChange: false, emitViewToModelChange: false } initializeForm() { if (this.data.action == 'add') { this.form = new FormGroup({ NAME: new FormControl(null,

What is the proper way for binding data to cascade dropdown / autocomplete lists in Angular?

℡╲_俬逩灬. 提交于 2021-01-28 11:14:38
问题 I use mat-autocomplete in several places in my project and fille them as shwon below on form loading: countries: CountryDto[] = []; cities: CityDto[] = []; getCountries() { this.demoService.getCountries().subscribe((list: CountryDto) => { this.countries = list; }); } getCities(countryId) { this.demoService.getCities(countryId).subscribe((list: CityDto) => { this.cities= list; }); } However, when I tried to use a second list as cascade, I cannot make the second one to fill according to the

How to align a single md-tab element to the right

隐身守侯 提交于 2021-01-28 09:22:31
问题 Is it possible to align a single md-tab element to the right of md-tabs , while having the rest of the tabs remain where they are? ------------------------------------------------------------------------- | Tab 1 | Tab 2 | Tab 3 | | Select | ------------------------------------------------------------------------- I don't necessarily need the select element in a tab, but if I put the select outside of the md-tabs it shows up under the tabs, which isn't what I want. I know it looks like a

How to make mat-checkbox like a radio button

荒凉一梦 提交于 2021-01-28 06:01:54
问题 I have a mat-checkbox in the angular project. How to make a mat-checkbox can only be selected one. (No more than one). Here's the code I have: <mat-checkbox>Pre Order</mat-checkbox> <mat-checkbox>Order</mat-checkbox> Can anyone help? I want the mat-checkbox to behave like a mat-radio-button. 回答1: Just to get the correct answer: Use the mat-radio-button Set border-radius: 0%; for .mat-radio-outer-circle css class And that's it! Cheers! 来源: https://stackoverflow.com/questions/60143309/how-to