angularjs : logging scope property in directive link function displays undefined

前端 未结 3 2442
温柔的废话
温柔的废话 2021-02-20 17:30

I have this basic plnkr which just implements a basic \"Hello, X\" directive. In the link function I am logging scope.name but I get undefined? Why is

3条回答
  •  眼角桃花
    2021-02-20 18:13

    For those in 2015 who are reading this post, please note that the way Angular handles "@" attributes has changed. Angular 1.2 onwards, interpolation occurs prior to the invocation of the linking function.

    An excellent post on this topic is present here.

提交回复
热议问题