AngularJS: read initial value of ngModel.$viewValue from different directive

后端 未结 4 1960
南笙
南笙 2021-01-03 08:44

I would like to read the initial value ngModel.$viewValue from different directive.

# coffee script
app.directive \'directive\', -> 
  return {
      requ         


        
4条回答
  •  孤独总比滥情好
    2021-01-03 09:28

    If you want to work with some value from HTML inside your directive you should use ngInit. It will look like

    I faced the same problem, and it turned out that what I was doing was not an Angular way. Check this link for more details

提交回复
热议问题