ng2-ui / datetime-picker

Angular2 DateTime Picker
https://ng2-ui.github.io/#/datetime-picker
MIT License
121 stars 62 forks source link

ngui-datetime-picker user formControlName in FormArray has error #197

Open wqdjl opened 7 years ago

wqdjl commented 7 years ago

Solution: updae datetime-picker.directive.js line 203and 204,change this.parent["name"] for this.parent["path"] Error info:error_handler.js:60 TypeError: path.split is not a function at _find (model.js:45) at FormGroup.AbstractControl.get (model.js:579) at NguiDatetimePickerDirective.ngOnInit (datetime-picker.directive.js:203) at Wrapper_NguiDatetimePickerDirective.ngDoCheck (/NguiDatetimePickerModule/NguiDatetimePickerDirective/wrapper.ngfactory.js:208) at View_PropertyAddComponent1.detectChangesInternal (/PropertyModule/PropertyAddComponent/component.ngfactory.js:361) at View_PropertyAddComponent1.AppView.detectChanges (view.js:425) at View_PropertyAddComponent1.DebugAppView.detectChanges (view.js:620) at ViewContainer.detectChangesInNestedViews (view_container.js:67) at CompiledTemplate.proxyViewClass.View_PropertyAddComponent0.detectChangesInternal (/PropertyModule/PropertyAddComponent/component.ngfactory.js:2815) at CompiledTemplate.proxyViewClass.AppView.detectChanges (view.js:425) at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (view.js:620) at CompiledTemplate.proxyViewClass.AppView.internalDetectChanges (view.js:410) at CompiledTemplate.proxyViewClass.View_PropertyAddComponent_Host0.detectChangesInternal (/PropertyModule/PropertyAddComponent/host.ngfactory.js:29) at CompiledTemplate.proxyViewClass.AppView.detectChanges (view.js:425) at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (view.js:620) at ViewContainer.detectChangesInNestedViews (view_container.js:67) at CompiledTemplate.proxyViewClass.View_LayoutComponent0.detectChangesInternal (/LayoutModule/LayoutComponent/component.ngfactory.js:2840) at CompiledTemplate.proxyViewClass.AppView.detectChanges (view.js:425) at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (view.js:620) at CompiledTemplate.proxyViewClass.AppView.internalDetectChanges (view.js:410) at CompiledTemplate.proxyViewClass.View_LayoutComponent_Host0.detectChangesInternal (/LayoutModule/LayoutComponent/host.ngfactory.js:40)

allenhwkim commented 7 years ago

Could you make a PR for this?

baremaximum commented 6 years ago

This solution doesn't work.

suisgrand commented 6 years ago

this works like a charm @wqdjl well done!

if you use the webpack bundle, just do as he says first, then type in the following commands: webpack --config webpack.config.vendor.js webpack

wqdjl commented 6 years ago

what is PR?

allenhwkim commented 6 years ago

a Pull Request