how to bind Bootstrap-datepicker element with angularjs ng-model?

后端 未结 11 755
囚心锁ツ
囚心锁ツ 2020-11-30 04:44

Here is the html for the date field :

11条回答
  •  日久生厌
    2020-11-30 05:27

    To solve this, I have my HTML looking like this:

    My ng-model wouldn't update, so I used this to fix it:

    $("#datetimepicker1").on("dp.change", function (e) {
        $scope.date.arrival = $("#arrival").val(); // pure magic
        $('#datetimepicker2').data("DateTimePicker").minDate(e.date); // this line is not relevant for this example
    });
    

提交回复
热议问题