Open ptitdam2001 opened 7 years ago
Is this enough?
From PR #99
var isElectron = window && window.process && window.process.type;
if (typeof define === 'function' && define.amd) {
define(['moment'], ngMaterialDatePicker);
} else if (typeof module !== 'undefined' && module && module.exports && (typeof require === 'function') && !isElectron) {
module.exports = ngMaterialDatePicker(require('moment'));
} else {
ngMaterialDatePicker((typeof global !== 'undefined' ? global : window).moment);
}
It looks like good!
Hi,
I'm just testing 1.6.6 version using webpack.
It is OK when you do a require('ng-material-datetimepicker');
but in general when you use require, it returns the name of module.
For example :
var ngMaterialDatetimepicker = require('ng-material-datetimepicker');
angular.module('mainModule', [ngMaterialDatetimepicker]);
It fails because your constructor return nothing. You should return the variable moduleName value at the end of function ngMaterialDatePicker(moment), it will resolve the issue
@ptitdam2001 is this ok?
Hi! It will be fun if the module is compatible with RequireJS/Webpack