angular.js - AngularJs directive isolation scope problem. How to map the variable corresponding to a certain attr
淡淡烟草味
淡淡烟草味 2017-05-15 16:57:11
0
2
596

Suppose there is:
$scope.myData = "some data";

The customized directive is like this
<my-directive data-source="myData"></my-directive>

What should I do if I want to get the data of $scope.myData in the directive (data-soucre is a variable parameter, but the form is uncertain. If necessary, it can also be written as scope.myData or the like)

How to write scope mapping

淡淡烟草味
淡淡烟草味

reply all(2)
小葫芦

Use @

in diecrive
洪涛

Already solved, just use property: =attr

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template