krescruz / angular-materialize

Angularjs directives for Materialize CSS Framework https://github.com/Dogfalo/materialize
MIT License
397 stars 129 forks source link

DatePicker can't refill the value from controller under Firefox #188

Closed chosa91 closed 4 years ago

chosa91 commented 8 years ago

Use below template if reporting an error

Describe the error in 1 sentence

The datepicker (input-date) component can't refill the value. The value is came from backend, but the value is setted up from a same configured datePicker but from another form.

Steps to reproduce

Error: invalid date o</<@https://cdnjs.cloudflare.com/ajax/libs/angular-materialize/0.2.1/angular-materialize.min.js:1:7884 Date.prototype.format@https://cdnjs.cloudflare.com/ajax/libs/angular-materialize/0.2.1/angular-materialize.min.js:1:9493 .link/<@https://cdnjs.cloudflare.com/ajax/libs/angular-materialize/0.2.1/angular-materialize.min.js:1:10062 Mg</<@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js:285:113 tf/this.$get</n.prototype.$digest@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js:142:168 tf/this.$get</n.prototype.$apply@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js:145:247 l@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js:97:53 H@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js:101:190 dg/</u.onload@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js:102:229

webbiesdk commented 8 years ago

The stack-trace ends with the statement: if (isNaN(r)) throw SyntaxError("invalid date");. So somehow you manage to get the NaN value sent to the directive.

That is far from trivial to re-produce, and this is an error that could be caused by a number of things.

Could you create a sample application that has the error? You can use this excellent codepen as a starting poing: http://codepen.io/anon/pen/wWbVWX