-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global settings [materializeParams] ? #417
Comments
I have tackled this by creating a config.ts file like the following export const CONFIG = {
...
datePickerOptions: {
format: 'dd/mm/yyyy',
selectYears: 130,
selectMonths: true,
max: true,
monthsFull: [
'Januar',
'Februar',
'März',
'April',
'Mai',
'Juni',
'Juli',
'August',
'September',
'Oktober',
'November',
'Dezember'
]
}
...
}
Then on all the components you want to use it on import it and have a property return it
```typescript
import { CONFIG } from '..config';
...
public config = CONFIG.datePickerOptions;
... Then in your template simply do this <input type="date" [(ngModel)]="user.birth_date" name="birth_date" materialize="pickadate" placeholder="{{ 'BUTTON.DATE' | translate }}" [materializeParams]="[config]" required /> |
Thanks for update @pain0486 i ended up ripping off this lib and making up my own directive because i needed also translations..i am far from being TS expert but this works...
|
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How can i provide global [materializeParams] setting for example for all date pickers in app ?
<input type="date" [(ngModel)]="user.birth_date" name="birth_date" materialize="pickadate" placeholder="{{ 'BUTTON.DATE' | translate }}" [materializeParams]="[{format:'dd/mm/yyyy', selectYears: 130, selectMonths: true, max: true, monthsFull: [ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember' ] }]" required />
The text was updated successfully, but these errors were encountered: