JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="myapp" ng-controller="MyCtrl">
<my-directive one="{{40 + 2}}" two="myVariable"></my-directive>
</div>
JavaScript
angular
.module('myapp', [])
.directive('myDirective', function() {
return {
restrict:'E',
scope: {
one: '@',
two: '='
},
controller: function($scope) {
alert('$scope.one = ' + $scope.one + '\n' +
'$scope.two = ' + $scope.two);
}
}
})
.controller('MyCtrl', function($scope) {
$scope.myVariable = "Hello World !";
})