Skip to content
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

Error changing route on change event #219

Open
miscillo opened this issue Oct 6, 2017 · 0 comments
Open

Error changing route on change event #219

miscillo opened this issue Oct 6, 2017 · 0 comments

Comments

@miscillo
Copy link

miscillo commented Oct 6, 2017

Hi.

I need to build a page that on changing a date, it will go to a specific page (using angular ui router).

I add this html code
<input class="form-control" change="onChange(date)" ng-model="date" placeholder="Select a date..." format= "DD/MM/YYYY" moment-picker="date">

and the onChange function is like this:
$scope.onChange = function(date){
var date = moment(date, "DD/MM/YYYY");
$state.go('list', {day: date.get('date'), month: (date.get('month')+1), year: date.get('year')})
}

But In console I have this error
VM3314:27 TypeError: Cannot read property 'removeChild' of null at close (angular-moment-picker.min.js:formatted:299) at angular.js:20440 at e (angular.js:6362) at angular.js:6642
VM3314:27 TypeError: Cannot read property 'removeChild' of null at close (angular-moment-picker.min.js:formatted:299) at angular.js:20440 at e (angular.js:6362) at angular.js:6642 "Possibly unhandled rejection: {}"

I discover that delaying the $state.go function is enogh to avoid this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant