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

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

Here is the html for the date field :

11条回答
  •  借酒劲吻你
    2020-11-30 05:14

    As @lort suggests, you cannot access the datepicker model from your controller because the datepicker has its own private scope.

    If you set: ng-model="parent.checkOut"

    and define in the controller: $scope.parent = {checkOut:''};

    you can access the datepicker using: $scope.parent.checkOut

提交回复
热议问题