angular-material

Error: No provider for ChildrenOutletContexts [duplicate]

99封情书 提交于 2020-01-01 04:19:15
问题 This question already has answers here : No provider for ChildrenOutletContexts (injectionError) (3 answers) Closed 2 years ago . I can not make use of angular/material with Angular 5 in any way. I followed this simple Tutorial, but whenever I insert some material tag in component HTML, the web page gets blank. Angular CLI does not show any issues when using ng serve Dependencies: "dependencies": { "@angular/animations": "^5.0.5", "@angular/cdk": "^5.0.0-rc.2", "@angular/common": "^5.0.0", "

angular material stepper: disable header navigation

房东的猫 提交于 2020-01-01 03:53:06
问题 I want to navigate the stepper only through the next and back buttons. I can't get this to work since users can also click each step label to navigate to any step. I can't use linear, since it requires each step to have a formArray or FormGroup . I have tried <mat-step (click)="$event.stopPropagation()"> . 回答1: Add this to your style sheet. I was trying to disable the header navigation. Tried many things but this hack worked. You can try this till Angular Material Team support this feature. :

Angular Material editable table using FormArray

ぃ、小莉子 提交于 2020-01-01 02:26:28
问题 I'm trying to build an inline editable table using the latest material+cdk for angular. Question How can I make mat-table use [formGroupName] so that the form fields can be referenced by its correct form path? This is what I got so far: Complete StackBlitz example Template <form [formGroup]="form"> <h1>Works</h1> <div formArrayName="dates" *ngFor="let date of rows.controls; let i = index;"> <div [formGroupName]="i"> <input type="date" formControlName="from" placeholder="From date"> <input

How to use input type file in angular material

こ雲淡風輕ζ 提交于 2020-01-01 01:27:29
问题 How to use input type file in angular material Hi, I am using angular material for designing. when i go on angular material site there no input type file element. anyone know about this. 回答1: Angular Material does not support yet a workaround for file upload. There are alternative to archieve this. e.g using external libraries. angular-material-fileupload : link to npm package Supported features : Drag and drop common uploads progress bar file size and more... ngx-material-file-input : Link

How to pick date range in angular material 5.0.0 with datepicker?

眉间皱痕 提交于 2019-12-31 12:14:08
问题 I am using the latest Angular Material 5.0.0-rc0 in my Angular 5 app. I am trying to select a range of dates with the datepicker provided with Angular material, but I couldn't find any documentation regarding that. All I could work with it is to select a startDate or set the minDate and maxDate . Here's the HTML code for that <mat-form-field> <input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="picker" placeholder="Choose a date"> <mat-datepicker-toggle matSuffix [for]="picker"><

Dynamic nested Material menu from json object in Angular 5

三世轮回 提交于 2019-12-31 10:33:24
问题 How to create dynamic nested menu from json object? I started using Angular Material Design today for the first time and I'm trying to create nested menus using material design. The documentation is pretty straight forward for static stuff. But I need to create dynamic nested menu from json object and I can't find a simple solution to this anywhere. It just needs to be one level deep. json object(not set in stone): my_menu = { 'main1': ['sub1', 'sub2'], 'main2': ['sub1', 'sub2'], } which

Dynamic nested Material menu from json object in Angular 5

人走茶凉 提交于 2019-12-31 10:33:22
问题 How to create dynamic nested menu from json object? I started using Angular Material Design today for the first time and I'm trying to create nested menus using material design. The documentation is pretty straight forward for static stuff. But I need to create dynamic nested menu from json object and I can't find a simple solution to this anywhere. It just needs to be one level deep. json object(not set in stone): my_menu = { 'main1': ['sub1', 'sub2'], 'main2': ['sub1', 'sub2'], } which

Unable to load the POPUP in angular using angular material

别等时光非礼了梦想. 提交于 2019-12-31 03:57:05
问题 I have created a sample stackblitz demo implementing a simple angular material table in the popup component. I have also taken an empty table where I am pushing the selected table rows from my first table to second empty table. But the problem is here I am unable to run the stackblitz example, I tried out various ways to fix the issue but I am unable to find the solution. Can anybody please help me out in resolving the issue "popup undefined" And also when I am transferring table rows to the

How to use Angular Material MAT_AUTOCOMPLETE_DEFAULT_OPTIONS injection token

半腔热情 提交于 2019-12-30 18:55:24
问题 What is the way to use the MAT_AUTOCOMPLETE_DEFAULT_OPTIONS injection token, or the const AUTOCOMPLETE_OPTION_HEIGHT to customize mat-autocomplete. These constants, among others are exposed in the public API here but no documentation on how to use them 回答1: Add MAT_AUTOCOMPLETE_DEFAULT_OPTIONS to your module's providers array like this: providers: [ // ... {provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, useValue: {autoActiveFirstOption: false}} ] As for the other constants, I'm not sure you can

How to use Angular Material MAT_AUTOCOMPLETE_DEFAULT_OPTIONS injection token

泄露秘密 提交于 2019-12-30 18:55:12
问题 What is the way to use the MAT_AUTOCOMPLETE_DEFAULT_OPTIONS injection token, or the const AUTOCOMPLETE_OPTION_HEIGHT to customize mat-autocomplete. These constants, among others are exposed in the public API here but no documentation on how to use them 回答1: Add MAT_AUTOCOMPLETE_DEFAULT_OPTIONS to your module's providers array like this: providers: [ // ... {provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, useValue: {autoActiveFirstOption: false}} ] As for the other constants, I'm not sure you can