Please see the example here
foodMeApp.directive(\'fmRating\', function() {
return {
restrict: \'E\',
scope: {
symbol: \'@\',
max: \'@\
Using attrs you are able to access the attributes defined in your html tag like
So in this case you will have access to the symbol and readonly attributes. Every attribute you define in your custom directive will be available to the attrs variable.
The block:
attrs.max = scope.max = parseInt(scope.max || 5, 10);
Will parse and assign the current scope.max value or 5, if non existent, to the scope.max and attrs.max. This way, after the assignment you can read from attrs.max. Before that the attrs.max property in undefined.
Inspecting the fmRating.js source i don't know why/where/when this piece of code is being used.