angular-material

Is it possible to disable mat-tab animations with pure css

耗尽温柔 提交于 2019-12-24 18:41:11
问题 I want to disable the Angular Material mat-tab animation (the animation that occurs as the content slides into place). I know it is possible to use the [@.disabled] attribute but I wonder if it is possible to achieve the same effect with pure css. EDIT: Our UX team wants to remove the slide animation from the material tabs since they think they are not appropriate for whatever reason. We have multiple projects that may use multiple times the tabs component, so we wanted a way to remove this

MatTable Row Span Drag & Drop Issue

无人久伴 提交于 2019-12-24 18:38:50
问题 I am trying to achieve drag and drop functionality in angular table row but the issue is the table I have has spanned row.When I try to drag and drop the spanned row it just pick up a single row instead of whole spanned row. I am using https://stackblitz.com/edit/angular-wudscb-kpjdfv to achieve row span in angular table. app.component.html <table mat-table [dataSource]="dataSource" class="mat-elevation-z8" multiTemplateDataRows cdkDropList [cdkDropListData]="dataSource" (cdkDropListDropped)=

Problem with mat-select when submitting form in angular

筅森魡賤 提交于 2019-12-24 15:02:02
问题 I use Angular7 with Angular Material, I have a form which contain a component which contain a mat-select. The select in the form out of my component work but not the one into my component. Viewable on this stackblitz : https://stackblitz.com/edit/angular-hqkcgq The actual result is that submiting form don't send the value of the select, but it have to. You can see in console when submiting the form. edit: the stackblitz is edited and now work as I want 回答1: For future, please add all relevant

Angular Material Autocomplete - How to allow user to add item not in suggested list?

为君一笑 提交于 2019-12-24 13:37:25
问题 I'm trying to implement the autocomplete component from Angular Material: https://material.angular.io/components/autocomplete/overview It works well for letting the user select a particular item from the suggested list but I also want to allow the user to add items not in the list. So lets say the suggested list has the following items: Cats Birds Dogs And the user starts typing "Do" and the autocomplete shows "Dogs" as the suggested option (because I'm also filtering the list based on what

Create Component without folder

柔情痞子 提交于 2019-12-24 11:24:55
问题 I need to create a component without the folder. I am using Angular-Cli command ng g c testing to create the component. But, the command creates an folder wrapper for the newly created component. 回答1: You can use --flat flag. ng g c test --flat For more information follow this link flat = true | false When true creates the new files at the top level of the current project. Default: false 回答2: You can create components anywhere inside the app folder without using commands if you are using any

How to set max-height for the scroll bar in autocomplete component

送分小仙女□ 提交于 2019-12-24 11:06:11
问题 I am using autocomplete component in my project, along with the autocomplete component i have added an button inside the component for adding a new customer as shown in below image. Here i want to achieve 2 things: 1) I want to make button as fixed even after the scroll(i,e Add New Customer). 2) I want to reduce the height of the scroll bar. How can i do this? Here is the forked stackblitz link 回答1: 1) Use position:sticky : .add-button{ position: sticky; top: 0; z-index: 2; } 2) Use height to

Show a list of items inside an ng-repeat when an input is selected with model

冷暖自知 提交于 2019-12-24 10:54:07
问题 So, I have this ng-repeat which has a model inside subj.Prerequisites, subj.Prerequisites can contain an array e.g ['SUBJ1', 'SUBJ2']. What i wanted to do is when i click on my input text inside this ng-repeat there will be a shown list of subjects below which allow multiple selection and then with the multiple selected items should be binded to the clicked input text. <div ng-repeat="subj in sem.subjects track by $index"> <md-input-container flex class="no-error-spacer uk-margin-remove">

How to modify the way the data table filter works in Angular Material?

淺唱寂寞╮ 提交于 2019-12-24 10:45:40
问题 I am trying to use the filter in Angular Material Data Table like - If I search for " MATCHED ", then both " MATCHED " and " UNMATCHED " comes up in the status column of the Data table. I know that it is because the data object is reduced and concatenated and the filter is applied( from the Angular Material Docs ). I want to display only the " MATCHED " status, if is search for matched. So I am looking for a filter that will do exact word filtering instead of substrings. How to proceed ? I

Angular return value from subscribe

人盡茶涼 提交于 2019-12-24 10:26:06
问题 I need to return value from subscribe of a service call. here is my code export class RideDataSource extends DataSource<any> { rides: Ride[]; constructor(private _rideService: RidesService, private _paginator: MatPaginator) { super(); } connect(): Observable<Ride[]> { this._rideService.getActiveRides(this._paginator.pageIndex, this._paginator.pageSize).subscribe( ridePage => { this.rides = ridePage.content; this._paginator.length = ridePage.totalElements; } ); // i need to return Observable

Detect click on the currently active tab. ( Angular material tab )

孤街醉人 提交于 2019-12-24 09:55:07
问题 I have a mat-tab group with different tabs. I want to detect click on the active tab header. Eg. I have 2 tabs- a company tab and a users tab and inside each tab there are 2 views - a list view view and a detailed view. Initially I want to load the list and on clicking on an item, want to go to the corresponding item's detailed view. But If I click on the tab header again I want to goto the list view again. There are events like ( selectedTabChange ) which detects if tab is changed but since