Open jbouzekri opened 6 years ago
Steps to reproduce and a minimal demo
I could not do a plunkr. I don't know how to do it with webpack loader and typescript support. Sorry.
These are the steps to reproduce it :
init a simple AngularCLI project :
ng new myapp npm install --save moment npm install @ngui/datetime-picker --save
In AppModule, add :
import * as moment from 'moment'; import 'moment/min/locales';
In AppComponent html file, add :
<input type="text" ngui-datetime-picker name="start_date" [(ngModel)]="start_date" id="form-startdate" class="form-control" date-format="DD-MM-YYYY hh:mm:ss" required />
The ngModel bindings works but the field stays empty. I think the issue is here : https://github.com/ng2-ui/datetime-picker/blob/master/src/datetime.ts#L80 You are waiting for a global moment library and not one imported using an import declaration.
Current behavior
The date-format attribute is ignored as it does not find the moment library which is loaded as an import and not a global.
Expected/desired behavior
Loading the moment library as an import should be the recommended way of handling it.
Steps to reproduce and a minimal demo
I could not do a plunkr. I don't know how to do it with webpack loader and typescript support. Sorry.
These are the steps to reproduce it :
init a simple AngularCLI project :
In AppModule, add :
In AppComponent html file, add :
The ngModel bindings works but the field stays empty. I think the issue is here : https://github.com/ng2-ui/datetime-picker/blob/master/src/datetime.ts#L80 You are waiting for a global moment library and not one imported using an import declaration.
Current behavior
The date-format attribute is ignored as it does not find the moment library which is loaded as an import and not a global.
Expected/desired behavior
Loading the moment library as an import should be the recommended way of handling it.