I'm trying to make an Angular directive which takes some data and modifies a scope variable based on the input, but I can't get it to work.
Here is a simplified version of my JS:
var module = angular.module('myapp', []);
module.directive('checkDirective', function() {
return {
restrict: 'E',
scope: { line: '@' },
transclude: true,
controller: function($scope) {
$scope.newLine = $scope.line;
},
template: '<div ng-transclude></div>'
};
});
And here is my HTML:
<div ng-app="myapp">
0
<check-directive line="...">
a{{line}}b{{newLine}}c
</check-directive>
1
</div>
A fiddle for it is here: http://jsfiddle.net/k66Za/60/
Any help would be appreciated!