angular-material

How do I set mdButton text to lowercase?

别来无恙 提交于 2019-12-23 07:45:43
问题 As you can see from here, mdButton will set your text with uppercase letters. What if I want to make lowercase? 回答1: Write your own class using css text-transform such as, .tolowercase { text-transform: lowercase; } .tocapitalize { text-transform: capitalize; } And apply it to the input/button. If you want htis behaviour throughout the system override the .md-button class in your css, .md-button { text-transform: capitalize !important;/*For Lower case use lowercase*/ } 回答2: in XML: android

Angular Material Tabs SelectedIndex 0 not working

半腔热情 提交于 2019-12-23 07:39:34
问题 I have a tab group in Angular. I want that by default the first tab will be selected. However, when I set the selectedIndex to 0, it doesn't select the first tab, while setting it to 1 or 2 does select the other tabs. This is my app.component.html: <mat-toolbar color="primary"> <span color="white">קשת נחושה</span> <span class="spacer"></span> <button mat-icon-button> <mat-icon class="example-icon">more_vert</mat-icon> </button> </mat-toolbar> <mat-tab-group mat-stretch-tabs [selectedIndex]="0

Angular 6 Material Data Table with Fixed Header and Paginator

让人想犯罪 __ 提交于 2019-12-23 07:26:54
问题 How to make the Header of Data Table component fixed to the top, and the Paginator fixed to the bottom? This is my HTML: <div class="example-container mat-elevation-z8"> <table mat-table #itemsTable [dataSource]="dataSource" class="items-list"> <ng-container matColumnDef="position"> <th mat-header-cell *matHeaderCellDef> No. </th> <td mat-cell *matCellDef="let element"> {{element.position}} </td> </ng-container> <ng-container matColumnDef="name"> <th mat-header-cell *matHeaderCellDef> Name <

how to show in html slide-toggle checked when acitve = 1 and not checked when active=0?

随声附和 提交于 2019-12-23 06:08:05
问题 I have a problem with my mat-slide-toggle. In web all my slide-toggle are checked like in .image I think that all of things are good, but in html display all checked. Please, can you suggest me any solution? I try to use, like in this post but nothing work for me. My code: ts code: this.activeHomeboxPForm = new FormGroup({ 'active': new FormControl(true, Validators.required), 'homeboxpackage_id': new FormControl('', Validators.required) }); populateFormHomeboxP() { this.ws.homeboxPGetAll()

How to implement dynamic flex value with Angular Material

对着背影说爱祢 提交于 2019-12-23 05:26:09
问题 I'm trying to build a div with uncertain number of child divs, I want the child div have flex="100" when there is only one of them, which takes the entire row. If there are more than one child divs (even if there are three or four child elements), they should all have exactly flex="50" , which will take half of the row. Any idea how could I do that? Thanks in advance. 回答1: Another way is <div flex="{{::flexSize}}"></div> and in controller define and modify flexSize e.g $scope.flexSize = 50;

To set default selected item in Select with multiple selection component [duplicate]

六眼飞鱼酱① 提交于 2019-12-23 04:57:23
问题 This question already has answers here : How to set default selected values in multiselect with ngModel in Angular 2 (4 answers) Closed last year . I am using Select with multiple selection component. I want to make 2 items to be selected by default like this. I have surfed,but i got resources only for Basic select component, How can i achieve this? 回答1: I have done it here please check https://stackblitz.com/edit/angular-zs2wa5?file=app/select-multiple-example.ts export class

How to show highlight error in md-input-container when click submit?

别说谁变了你拦得住时间么 提交于 2019-12-23 04:56:21
问题 I have updated material then I update my code like that <md-input-container> <label>Last Name</label> <input name="lastName" ng-model="lastName" required> <div ng-messages="userForm.lastName.$error" ng-show="userForm.lastName.$dirty"> <div ng-message="required">This is required!</div> </div> </md-input-container> It will highlight on the input when I dirty the field; however, I want to click on submit button and show highlight on the input even I don't dirty that required field. Here is my

Integrate mat-table with AngularFirestore

你说的曾经没有我的故事 提交于 2019-12-23 03:54:09
问题 I would like to integrate mat-table from https://material.angular.io/ with angularfire2/firestore https://github.com/angular/angularfire2, some idea, I am very lost best regard 回答1: This is how you do it for simple table. In your html file put this. <mat-table [dataSource]="myData"> <ng-container matColumnDef="name"> <mat-header-cell *matHeaderCellDef>name</mat-header-cell> <mat-cell *matCellDef="let element"> {{element.name}} </mat-cell> </ng-container> <ng-container matColumnDef=

How to use flex layout along with md-card in the grid in angular 2?

天涯浪子 提交于 2019-12-23 03:05:18
问题 I am using "@angular/core": "2.4.10" and "@angular/material": "2.0.0-beta.2". I have installed flex-layout using npm. I want to design responsive grid with cards. I am using md-grid-list and md-card. How do I use flex layout with md-card or md-grid-list. The grid and the card should be responsive according to the window/screen size. Expected result: As soon as I decrease the screen size, the number of columns should be reduced and when the screen size is big the number of columns should

UI-Router : State redirecting to first child on page refresh

戏子无情 提交于 2019-12-23 02:46:36
问题 I am working on an AngularJS app using UI router with multiple named views. My app has one ui-view in index.html and states are configured as : $stateProvider .state('login', { url : '/', templateUrl : "partials/login.html", controller : "login-controller" }) .state("portal", { url :"", abstract : true, templateUrl : "partials/header.html", }) .state("portal.create-claim", { url : "/dashboard", views : { 'create-claim' : { templateUrl : "partials/create-claim.html", controller : "create-claim