angular-material

How to show a form on a dropdown in angular material?

梦想的初衷 提交于 2020-01-14 02:08:27
问题 I want to show a simple form (as shown in image below) as a dropdown when an icon is clicked. I looked into the component list of angular material but I couldn't find any suitable component for this. There is menu but that can't be used in this case. Does someone know how can I achieve this? 回答1: You can use MatMenu, but you need to do a few things to make it work. The first is to not use mat-menu-item . This forces styling on the item so that it has a fixed height of what you would expect

Angular Material - md-virtual-repeat in list - scroll/loading/display issue

偶尔善良 提交于 2020-01-13 11:38:06
问题 When scrolling down a list under md-virtual-repeat there is an inconsistency between scroll and display speed. Items are not being displayed fast enough to keep up with the scroll speed. It also scrolls 'past the list' so that white space is displayed at the bottom (whereas it should have stopped scrolling). See codepen: http://codepen.io/sweatherly/pen/PzKRLz md-list-item, md-list-item ._md-list-item-inner { min-height: 32px; } The problem is aggravated by changing min-height on "md-list

Show progress circular during $http post?

与世无争的帅哥 提交于 2020-01-12 05:18:32
问题 What is the best way to use Angular Material's Progress circular component with a $http request? I currently have the code like this below: Progress circular: <md-progress-circular ng-if="determinateValue === 100" md-mode="determinate" value="{{determinateValue}}"></md-progress-circular> $http request: $scope.determinateValue = 0; $http.get("/posts") .success(function (data) { $scope.posts = data; $scope.determinateValue = 100; }) 回答1: I don't think you need the value attribute here with

Show progress circular during $http post?

匆匆过客 提交于 2020-01-12 05:18:05
问题 What is the best way to use Angular Material's Progress circular component with a $http request? I currently have the code like this below: Progress circular: <md-progress-circular ng-if="determinateValue === 100" md-mode="determinate" value="{{determinateValue}}"></md-progress-circular> $http request: $scope.determinateValue = 0; $http.get("/posts") .success(function (data) { $scope.posts = data; $scope.determinateValue = 100; }) 回答1: I don't think you need the value attribute here with

Angular Material - Custom Autocomplete component

不羁的心 提交于 2020-01-12 03:23:06
问题 I'm trying to create my own custom angular material component that would be able to work with a mat-form-field control. Added to that, I'd like the control to use the mat-autocomplete directive. My aim is simply to create a better-looking mat-autocomplete component with an integrated clear-button and custom css arrow like the following image. I have succesfully obtained it by using the standard component and added what I wanted but now I want to export it into a generic component. I'm using

Angular Material and Jasmine : “ No provider for InjectionToken MdDialogData! ”

痞子三分冷 提交于 2020-01-11 21:10:00
问题 I have a component which is meant to be used in an Angular Material MdDialog : @Component({ ... }) export class MyComponent { constructor(@Inject(MD_DIALOG_DATA) public data: any, public dialogRef: MdDialogRef<MyComponent>) { ... } } I am trying to Unit Test it with Jasmine : describe('MyComponent', () => { let component: MyComponent; let fixture: ComponentFixture<MyComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ imports: [ SharedTestingModule, ], declarations: [

Angular Material and Jasmine : “ No provider for InjectionToken MdDialogData! ”

我怕爱的太早我们不能终老 提交于 2020-01-11 21:09:39
问题 I have a component which is meant to be used in an Angular Material MdDialog : @Component({ ... }) export class MyComponent { constructor(@Inject(MD_DIALOG_DATA) public data: any, public dialogRef: MdDialogRef<MyComponent>) { ... } } I am trying to Unit Test it with Jasmine : describe('MyComponent', () => { let component: MyComponent; let fixture: ComponentFixture<MyComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ imports: [ SharedTestingModule, ], declarations: [

Angular Material Design - Change flex value with screen size

不打扰是莪最后的温柔 提交于 2020-01-11 17:15:28
问题 I'm new to AngularJS so please bear with me. I'm using Angular Material Design and I have difficulties in identifying a way to efficiently do responsive grids. Please see my comments in the code below: <div layout="row"> <div layout="row" flex="75" layout-sm="column" class="ptn-info-grid" layout-margin> <!-- USING ROW FOR DESKTOP AND COLUMN FOR MOBILE DEVICES --> <div layout="column" flex="66"> <!-- I want this div occupy 2/3 of screen in Desktop but change to 100 in mobile devices (but stays

Custom Component MdDatePicker used in reactive Form

别来无恙 提交于 2020-01-11 13:15:18
问题 I am trying to create a custom component to be used in a angular formGroup. Here's is how I want to use this custom component: <form [formGroup]="form"> ... <app-date-picker formControlName="dateStart" [isConsultation]="isConsultation" [label]="'Du'" [(ngModel)]="agenda.datDeb"> </app-date-picker> ... </form> Problem : In the main component (containing this form), The model doesn't get updated when the value changes in my custom component, which is involving a MdDatePicker. Though I am using

Custom Component MdDatePicker used in reactive Form

孤街浪徒 提交于 2020-01-11 13:15:09
问题 I am trying to create a custom component to be used in a angular formGroup. Here's is how I want to use this custom component: <form [formGroup]="form"> ... <app-date-picker formControlName="dateStart" [isConsultation]="isConsultation" [label]="'Du'" [(ngModel)]="agenda.datDeb"> </app-date-picker> ... </form> Problem : In the main component (containing this form), The model doesn't get updated when the value changes in my custom component, which is involving a MdDatePicker. Though I am using