angular-material

How to select the dropped data UI based on the value present in the dropped item

白昼怎懂夜的黑 提交于 2019-12-25 00:33:54
问题 Hi I am using angular 7 drag and drop feature. I am following this link https://stackblitz.com/edit/angular-material-drag-copy?file=app%2Fapp.component.html I want to check the data which is being dropped and based on the value i need to set whether it is a mat expansion panel or mat list. which is to be shown in the ui. I am using ngrepeat for generating the list items in both the drag and dropped place. Basically I want to decide the UI element which is to used based on the value that is

Angular Material Table Sorting - Data Doesn't sort when inside a *ngIf condition

不羁的心 提交于 2019-12-25 00:23:53
问题 I have a Angular Material Table. When I surround html for the table with a <div *ngIf="true"> the table renders but the data no longer sorts when clicking on the header column. Taking the example from: https://material.angular.io/components/table/overview#sorting And modifying it, just by adding the <div *ngIf="true"> ... </div> demonstrates this behavior. Example is at: https://stackblitz.com/edit/angular-quzvjv 回答1: Do the console log in ngOnInit of this.sort Angular didn't catch MatSort

how to build angular project with different environment

一笑奈何 提交于 2019-12-25 00:23:41
问题 I am using Angular 5.2 and I need to bundle like it does with ng build --prod but with the different environment I tried: ng build --env=qa --aot --vendorChunk --common-chunk --output-hashing=bundles but it does not give me the same bundling as i see with --prod it generates both a .js and .js.map file main.66dc6fba707fe2f3314c.bundle.js main.66dc6fba707fe2f3314c.bundle.js.map What options should I use to get me the same result at --prod but with a different environment? 回答1: In angular 6 you

How can I make it so only this `mat-card-subtitle` in this above header gets color red?

不羁岁月 提交于 2019-12-24 21:40:06
问题 I learn Angular material and I have this code <mat-card-header> <mat-card-title>Search for books</mat-card-title> <mat-card-subtitle>press enter on search</mat-card-subtitle> </mat-card-header> and this css .mat-card-subtitle { font-size: 10px; color: red; } The problem is now all <mat-card-subtitle> gets the color red. How can I make it so only the mat-card-subtitle in this above header gets color red? 回答1: Add a custom CSS class in HTML <mat-card-header> <mat-card-title>Search for books<

Mat-Stepper - change specific steps to just dots

≯℡__Kan透↙ 提交于 2019-12-24 20:57:01
问题 I've seen this post on how to remove the header Remove the Material Stepper header But all I want on specific steps is to display none on span showing the number. Hide this inner part of the stepper: <span class="mat-step-icon-content ng-star-inserted">1</span> I tried with id and .span:after or just .span with display none, but no luck.. #importer > .span{ display:none; } This one works but I don't want it to disappear all together.. just the number and just on specific steps.. ::ng-deep

Angular CanActivate With Login Dialog

陌路散爱 提交于 2019-12-24 20:32:32
问题 I have an AuthGuard in which I want to use a login material2 dialog with it. So before canActivate returns, the login dialog is shown and if the login is successful then the dialog returns true so then canActivate returns true as well. If the login is not successful, then the dialog does not return anything and tries again. I have already implemented the dialog in a component and its working fine, I'm looking for help on how to integrate it with the canActivate guard. @Injectable() export

TypeScript for loop in a nested Array

末鹿安然 提交于 2019-12-24 19:42:55
问题 I am learning Angular and ran into this problem which I hope this community would help me with...I am posting for the first time. So, I have an array that looks something like : {moduleId : 1,moduleName: "module1",clauseObj: [{clauseId : 1, moduleId:1, clauseName : "clause1", clauseType : "sc",parentclause : 2 textArray : [{text : "text 1 clause"}] }, {clauseId : 2 , moduleId : 1, clauseName : "clause2",clauseType : "C",textArray:[{ text : "text 2clause" }]}]} The data is coming from the

Upgrading to Angular Material 5

限于喜欢 提交于 2019-12-24 19:07:57
问题 I am using a beta 8 of Angular Material in my project. It was never been updated since then. Now that v5 is available, we'd like to do so. What things should I consider while doing so? Any information or pointer to it would be really helpful. Thanks! 回答1: What you have to do is the following: Since MaterialModule has been removed, you have to import the modules required for your application separately to either another module (such as MyMaterialModule and making sure that it is after

Angular Material Autocomplete: onfocus keep suggestion panel closed

你。 提交于 2019-12-24 19:04:52
问题 I am using Angular Material 7.3.7 and i have a simple autocomplete similiar like in the documentation: <form class="example-form"> <mat-form-field class="example-full-width"> <input type="text" placeholder="Pick one" aria-label="Number" matInput [formControl]="myControl" [matAutocomplete]="auto"> <mat-autocomplete #auto="matAutocomplete"> <mat-option *ngFor="let option of options" [value]="option"> {{option}} </mat-option> </mat-autocomplete> </mat-form-field> </form> Is there any way to keep

Implementing filter for table in angular 2 based on entered values

China☆狼群 提交于 2019-12-24 18:43:53
问题 I am trying to implement search option for my table created using angular material. I have taken a input with Account ID and Department dropdown .I have implemented HTTP get service to fetch data from json file into my Department dropdown. I able to fetch data in to my table from the json file using the get request. But as I enter the value in my input field and click on search ,it should list me the rows with entered account id. I have implemented the search event on Search button ,but I am