These are chat archives for angular/material

31st
Jan 2018
parker789
@parker789
Jan 31 2018 04:43
Hello, anyone here have any experience using $mdDateLocaleProvider with md-datepicker? I’m having issues with a pre-populated date getting set to the date -1. aka. new Date(‘2018-01-01’) results in a date object of Dec 31, 2017. I’m trying to find a way to run this date through momentjs using the provider any time there is a changed to the model value
Bas van den Heuvel
@basvandenheuvel
Jan 31 2018 08:40
Guys, i have no idea what i'm doing wrong, but i can't get a function triggered when another option in my <mat-select> is selected...
TudorIoanMarin
@TudorIoanMarin
Jan 31 2018 08:52
Hi, can someone explain why the material tabs(mat-tabs) behave like they create a new scope? I tried to add syles to the header and was able to do it only in the global css. Now I have forms inside them and they post an empty {}
TudorIoanMarin
@TudorIoanMarin
Jan 31 2018 09:26
If anyone has this problem, I solved it using form builder, which I think it's the proper way to do it anyhow.
Achille
@achillesimo
Jan 31 2018 10:10
Hello
please how to mark mat-select as readOnly ?
Fin Christensen
@fin-ger
Jan 31 2018 13:35

Hey, I am currently trying to use the mat-table. I copy pasted this example from the docs into my project: https://stackblitz.com/angular/pdmdkjdblme

When running my application I get ERROR TypeError: Cannot read property 'nativeElement' of undefined. I have all the dependencies in the exact same version installed as on stackblitz... Does anyone has an idea? I tried to reproduce the issue on stackblitz but wasnt able to.

Benjamin Charity
@benjamincharity
Jan 31 2018 13:36
@achillesimo I don't believe there is a built in way. But you could set disabled on the menu items themselves..
Mindaugas Dev
@BogalooDev
Jan 31 2018 13:48
@fin-ger do you have any *ngIf in your non working code. Looks like that you are trying to access @ViewChild element when it's not created yet
Fin Christensen
@fin-ger
Jan 31 2018 13:49
@BogalooDev No, I'm using the table test component as my root component
Fin Christensen
@fin-ger
Jan 31 2018 13:58
This is the whole stacktrace: https://dpaste.de/ci4c
Mindaugas Dev
@BogalooDev
Jan 31 2018 14:09
@fin-ger have you installed cdk also ?
Fin Christensen
@fin-ger
Jan 31 2018 14:09
I have @angular/cdk 5.1.1 installed
Mindaugas Dev
@BogalooDev
Jan 31 2018 14:13
Here are import from my working code // third party components
import { MatTableModule} from '@angular/material/table';
import { MatSortModule} from '@angular/material/sort';
import { CdkTableModule } from '@angular/cdk/table';
also small difference is "@angular/material": "~5.0.4", "@angular/cdk": "~5.0.4",
parker789
@parker789
Jan 31 2018 14:15
bump on my question: Hello, anyone here have any experience using $mdDateLocaleProvider with md-datepicker? I’m having issues with a pre-populated date getting set to the date -1. aka. new Date(‘2018-01-01’) results in a date object of Dec 31, 2017. I’m trying to find a way to run this date through momentjs using the provider any time there is a changed to the model value
Fin Christensen
@fin-ger
Jan 31 2018 14:16
@BogalooDev I have all 3 modules imported and listed in my NgModule imports
Fin Christensen
@fin-ger
Jan 31 2018 15:47
ok the error seems to only happen when the target in tsconfig is set to something else than es5
Is this intended behavior? Is this behavior documented?
Fin Christensen
@fin-ger
Jan 31 2018 15:57
I reproduced the error here: https://github.com/fin-ger/mat-table-es6
Ok seems like this is already known: angular/material2#9329