AngularJS - how to change the value of ngModel in custom directive?

后端 未结 5 1075
再見小時候
再見小時候 2020-12-23 09:53

Lets take a look to my directive:

angular.module(\'main\').directive(\'datepicker\', [
function() {
    return {
        require: \'?ngModel\',
        link:         


        
5条回答
  •  太阳男子
    2020-12-23 10:08

    Here's the best explanation I've encountered. This helped me big time, and brings together details from a number of the other answers here.

    TIP: Be careful to read the whole article rather than skim it, or else you are likely to miss some key bits!

    https://www.nadeau.tv/post/using-ngmodelcontroller-with-custom-directives/

提交回复
热议问题