angular-material

AngularJS Material Tab height issue

不羁岁月 提交于 2019-12-21 07:23:12
问题 I'm having some troube figuring things out with AngularJS Material, I was wondering if anyone knew why the folling piece of code: <md-tabs layout-fill > <md-tab id="tab1"> <md-tab-label>Item One</md-tab-label> <md-tab-body> <md-list> <md-subheader class="md-no-sticky">3 line item</md-subheader> <md-list-item class="md-3-line" ng-repeat="item in [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,50]"> <div class="md-list-item-text"> <h3>sdfs</h3> <h4>sdfsd</h4

AngularJS Material Tab height issue

北城余情 提交于 2019-12-21 07:23:08
问题 I'm having some troube figuring things out with AngularJS Material, I was wondering if anyone knew why the folling piece of code: <md-tabs layout-fill > <md-tab id="tab1"> <md-tab-label>Item One</md-tab-label> <md-tab-body> <md-list> <md-subheader class="md-no-sticky">3 line item</md-subheader> <md-list-item class="md-3-line" ng-repeat="item in [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,50]"> <div class="md-list-item-text"> <h3>sdfs</h3> <h4>sdfsd</h4

how do i create a grid of cards with angular material?

末鹿安然 提交于 2019-12-21 07:11:02
问题 I am trying to create a grid of three cards per row using ng-repeat. I have a normal array of javascript objects attached to the scope. The code below will create a fresh row for every card. <div layout="row" ng-repeat='post in posts' layout-fill="" layout-align=""> <md-card> <md-card-content> <h2 class="md-title">{{post.title}}</h2> <p> {{post.summary}} </p> </md-card-content> <div class="md-actions" layout="row" layout-align="end center"> <md-button>View More</md-button> </div> </md-card>

how do i create a grid of cards with angular material?

谁都会走 提交于 2019-12-21 07:10:04
问题 I am trying to create a grid of three cards per row using ng-repeat. I have a normal array of javascript objects attached to the scope. The code below will create a fresh row for every card. <div layout="row" ng-repeat='post in posts' layout-fill="" layout-align=""> <md-card> <md-card-content> <h2 class="md-title">{{post.title}}</h2> <p> {{post.summary}} </p> </md-card-content> <div class="md-actions" layout="row" layout-align="end center"> <md-button>View More</md-button> </div> </md-card>

Angular 2 material mat-tab size

喜欢而已 提交于 2019-12-21 03:48:50
问题 I have the following piece of code <mat-tab-group> <div *ngFor="let question of subcategory.questions"> <mat-tab label={{question.question_id}} class="question-tab">{{question.question}}</mat-tab> </div> </mat-tab-group> which displays like: However I want to reduce tabs width, like this: The problem is, when I change css at run time, it adjusts fine, but when I put css like: .mat-tab { min-width: 50px !important; } .mat-tab-label[_ngcontent-c9]{ min-width: 50px !important; } It doesn't work.

How to pass a template inside mat-stepper

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 03:42:52
问题 I would like to do that : <ng-template #content> <mat-step>step 1</mat-step> <mat-step>step 2</mat-step> </ng-template> <mat-horizontal-stepper> <ng-container *ngTemplateOutlet="content"></ng-container> </mat-horizontal-stepper> but i get this error ERROR Error: StaticInjectorError(AppModule)[MatStep -> MatStepper]: StaticInjectorError(Platform: core)[MatStep -> MatStepper]: NullInjectorError: No provider for MatStepper! I think this is because mat-step inject a mat-stepper in it's

How to use angular material (https://material.angularjs.org) in Angular 2 Apps?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 03:37:08
问题 I remember having seen angular-material.css being used in one of the Angular 2 Demos at ng-conf. Can someone confirm if this works... Also, is it possible to use the following in Angular 2 Apps: angular-material.js angular-animate.js angular-aria.js I know that above js have a dependency on Angular 1.3+, but what if I add that dependency over and above my Angular 2 dependency. Will these work then? 回答1: So currently you cannot use the current angular material with angular2. According to Marcy

Angular Material: md-autocomplete - how to hide md-autocomplete-suggestions on Enter event?

本小妞迷上赌 提交于 2019-12-21 03:34:06
问题 I have md-autocomplete : <md-autocomplete md-min-length="1" ng-enter="presEnter();" md-no-cache="true" md-selected-item="selectedItem" md-search-text="searchText" md-items="item in querySearch(searchText)" md-item-text="item.name" placeholder="Search for a vegetable"> <span md-highlight-text="searchText">{{item.name}} :: {{item.type}}</span> </md-autocomplete> with directive: ng-enter . My goal: When user presses Enter I want to hide md-autocomplete-suggestions dropdown I know from HTML I

Checkbox angular material checked by default

你说的曾经没有我的故事 提交于 2019-12-21 03:33:27
问题 I am trying to use an Angular Material checkbox, and set it by default as checked, but it is displayed as non-checked, what is wrong? <mat-checkbox class = "example-margin" [(ngModel)] = obj.impresora> <label>Printer</label> </mat-checkbox> obj.impresora property is boolean 回答1: You can either set with ngModel either with [checked] attribute. ngModel binded property should be set to 'true': 1. <mat-checkbox class = "example-margin" [(ngModel)] = "myModel"> <label>Printer </label> </mat

Writing unit test for component which uses mat-autocomplete

假如想象 提交于 2019-12-20 20:24:06
问题 I am new to Angular, I am trying to build a text field with autocomplete using Angular 5. I found this example in Angular Material docs: https://stackblitz.com/angular/kopqvokeddbq?file=app%2Fautocomplete-overview-example.ts I was wondering how to write a unit test for testing the autocomplete functionality. I am setting a value to the input element and triggering an 'input' event and tried selecting the mat-option elements, but see that none of them got created: Relevant part of my component