JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.min.js"></script>
<div ng-controller="TestController">
<directive value="data[val]"></directive>
</div>
JavaScript
var myApp = angular.module('myApp', [])
.controller('TestController', ['$scope', '$timeout', function ($scope, $timeout) {
$scope.data = {
test: 'test_val',
other: 'other_val'
};
$scope.val = 'test';
$timeout(function() {
$scope.val = 'other';
}, 4000);
}]);
myApp.directive('directive', function () {
return {
restrict: 'E',
scope: {
value: '='
},
template: '<div>{{value}}</div>',
link: function(scope, elt, attrs) {
console.log(scope);
}
};
});