I pass data from html using directive
<div ng-app="app" ng-controller="main">
<tempdir color="red"></tempdir>
</div>
and use it
var app = angular.module('app', []);
app.directive("tempdir", function() {
return {
template: "<div id={{color}}> ... </div>",
scope: {
color: "@"
}
};
});
app.controller('main', function($scope) {
// HOW TO CONSOLE.LOG "RED"?
console.log();
});
How to use variable color inside controller?