angular-material

Centering text vertically in a mat-header-col?

余生长醉 提交于 2019-12-25 18:46:27
问题 How do we center the header title in a <mat-header-cell> ? For example for: <mat-header-cell style="text-align: center" *matHeaderCellDef>Customer Orders</mat-header-cell> Tried style="text-align: center" but no love. The words Customer Orders should appear in a column like this: Customer Orders I thought about putting each word in a separate div, and aligning them with flexbox, but was wondering if there was a simpler way? Here's the markup for the flexbox approach: <mat-header-cell

How to run angularjs material documentation locally

南楼画角 提交于 2019-12-25 09:27:08
问题 I have compiled the newest angularjs material and find out that links in the doc all point to absolute URL material.angularjs.org/.... I want to be able to read the doc and demo content locally. 回答1: Follow these steps (for Windows users): Install git , Node v6.10.3 Git https://git-for-windows.github.io/ Node v6.10.3 https://nodejs.org/en/blog/release/v6.10.3/ Install dependencies npm , glub and http-server (use cmd or PowerShell) npm Insatall npm install npm@3.10.10 gulp Insatall npm install

Prevent autofill the saved password in angular material design

做~自己de王妃 提交于 2019-12-25 06:28:08
问题 How to prevent the password field from auto-fill with saved password in angular material design I have used autocomplete="off" it does not worked for me. <md-input-container class="md-block margin-top-10" flex-gt-sm> <input type="password" name="password" ng-model="auth.user.password" name="password" ng-required="true" autocomplete="off" > </md-input-container> 回答1: As far as I know this is an issue for material, as documented here. As mentioned in the comments there is a workaround for this

Displaying a mat-select inside a modal dialog

微笑、不失礼 提交于 2019-12-25 04:00:54
问题 I am displaying a mat-select inside a ngx-smart-dialog , when I open the select it shows behind the dialog. I found this and this with this solution: .cdk-global-overlay-wrapper, .cdk-overlay-container { z-index: 9999!important; } That's solves the issue if I put it in the global .scss file. What I want to know is (because in what I read I didn't find an explanation) why putting it inside the component's view (i.e., the modal component's view) it doesn't work. Thanks in advance! 回答1: By

How to make a list of cards, each one in its entire width, using a grid in Angular Material?

笑着哭i 提交于 2019-12-25 03:35:29
问题 I work with Angular 6 and Material, and I have a card component <mat-card> <mat-grid-list cols="12"> <mat-grid-tile colspan="3"><img [src]="urlAvatar" style="width:250px;height:200px"></mat-grid-tile> <mat-grid-tile colspan="6">{{doctor.SecondName}} {{doctor.FirstName}} {{doctor.ThirdName}}</mat-grid-tile> <mat-grid-tile colspan="3">{{doctor.Specialization}}</mat-grid-tile> </mat-grid-list> </mat-card> and I have a component where I display the list of these cards <mat-grid-list cols="12">

Transferring row data from between two tables in angular using angular material

我是研究僧i 提交于 2019-12-25 03:17:27
问题 I have created a sample angular app where I have taken TableComponent as my main page and also I have a popup in the TableComponent. When I click on the OpenPopup button in my main page I get a Popup window with two tables. The first table has a list of data rows and my second table is empty. When I transfer the rows from my first table to second table and click on save button ,the data rows from second table is displayed on the main page table. But my issue is when I am opening the popup for

mat-datepicker makes the app crash without logged error

瘦欲@ 提交于 2019-12-25 02:25:41
问题 I've got this page component template at the url /demo <mat-form-field> <input matInput placeholder="Choose a date"> </mat-form-field> Which renders fine, but as soon as I rewrite this as <mat-form-field> <input matInput [matDatepicker]="picker" placeholder="Choose a date"> <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle> <mat-datepicker #picker></mat-datepicker> </mat-form-field> the app redirects to the url / and does not displays anything but blank space. Nothing is

How to call a method from another component after view is fully loaded (AppComponent)?

两盒软妹~` 提交于 2019-12-25 01:26:45
问题 I'm using MatMenu from Angular Material inside HeaderComponent . I just need to open the Menu under certain conditions (method), calling this method on ProductDetailComponent . However this method only works inside ngAfterViewInit() , after the view is loaded. I found a way to comunicate from ProductDetailComponent to HeaderComponent , however there is a Children-Parent relationship to reach the components. HeaderComponent is called from AppComponent . Here is AppComponent <my-header

Angular 8: Cannot read property 'runOutsideAngular' of undefined

纵然是瞬间 提交于 2019-12-25 01:14:04
问题 When i run my app locally there is no problem whatsoever, but when the app is hosted (on firebase hosting) whenever I try to navigate to a page I get the following error: Cannot read property 'runOutsideAngular' of undefined . Because the code is minified to main.js I can't seem to find why the error is thrown. The error is thrown when the router should navigate to a different page. { path: 'manage/:bookingid', component: ManageBookingComponent }, Both pages use an Angular material Sidenav

floating label and placeholder overlapping

[亡魂溺海] 提交于 2019-12-25 00:33:57
问题 <div class="form-group form-default form-spacing"> <input class="form-control" placeholder="Name" type="text" required> <span class="form-bar"></span> <label class="float-label">Name</label> </div> here is css, .form-material { .form-group { position: relative; &.form-static-label .form-control { ~.float-label { top: -14px; } } } .form-control { &:focus { border-color: transparent; outline: none; box-shadow: none; } &:focus, &:valid { ~.float-label { top: -14px; } } } if i focus on text field