Skip to content
This repository was archived by the owner on May 28, 2019. It is now read-only.
This repository was archived by the owner on May 28, 2019. It is now read-only.

ngModel don't updated in controller #122

@quedicesebas

Description

@quedicesebas

I'm using ui-date with ng-model, and in the view the value is changed but in the controller remains undefined or with the value I use to initialize it:

Controller:

$scope.day = new Date;

$scope.dateOptions = {
minDate: '0',
dateFormat: 'yy-mm-dd'
};

$scope.checkSchedule = function () {

        console.log($scope.day);

};

View:

{{day}}

When I change the selected value, it's reflected in view (I have {{day}} after the datepiccker to see it). But when I submit the form, the value it's in today (because I inicialized as a new Date). And if I remove the inicilization, the value in the submit is undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions