I created angularjs directives:
'use strict';
angular.module('frontend')
.directive('overall', function() {
return {
restrict: 'E',
scope: {
data: '=data'
},
templateUrl: 'app/components/overall/overall.html',
controller: function($scope) {
alert($scope.data)
}
};
});
and template for him:
<div id="inner-overall">
Taras
</div>
After it in other page I use my directive like this:
<overall data></overall>
and js code:
$scope.data = 'daadad';
But it is not working, and I catch empty $scope.data value. I don't know why it happens and how to fix it, help me please with this issue. Thanks a lot!