Bootstrap DateTimePicker - on change event for Angular
<p>Given the demo below:</p>

<p><a href="http://jsfiddle.net/ADukg/8851/" rel="nofollow noreferrer">http://jsfiddle.net/ADukg/8851/</a></p>

<p>I want every time the date changes for my controller value to update. So every time a new date is selected from the box below the value for ng-model changes.</p>

<p><a href="https://i.stack.imgur.com/jM3Fy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jM3Fy.png" alt="enter image description here"></a></p>

<p>However upon using the following directive I get the error written above. </p>

<pre><code>app.directive('datetimepicker', function () {
    return {
        restrict: 'A',
        require : 'ngModel',
        link : function (scope, element, attrs, ngModelCtrl) {

            element.datetimepicker({

                onRender:function (date) {

                    // Triggers a digest to update your model
                    scope.$apply(function () {
                        ngModelCtrl.$setViewValue(date);
                    });

                }

            });
        }
    } 
});
</code></pre>

<p><strong>How can I detect changes in Angular for the Datetimepicker?</strong></p>